Skip to content

Commit

Permalink
release preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Oct 21, 2021
1 parent c756bbb commit 1d5357e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.3.0] - 2021-10-21
### Added
- New config variables `$dirMinJs` and `$dirMinCss` that allow to specify separate directories for minified assets - by [@daycry](https://github.com/daycry)

## [1.2.0] - 2021-01-01
### Added
- New config variable `$autoDeployOnChange` that specifies if we want to make a deploy automatically whenever any change happens to our assets files. Thanks to [@paul45](https://github.com/paul45) for inspiration.
Expand Down
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,18 @@

Asset minification and versioning library for CodeIgniter 4.

## Installation via composer
## Installation

> composer require michalsn/minifier

## Manual installation

Download this repo and then enable it by editing **app/Config/Autoload.php** and adding the **Michalsn\Minifier**
namespace to the **$psr4** array. For example, if you copied it into **app/ThirdParty**:

```php
$psr4 = [
'Config' => APPPATH . 'Config',
APP_NAMESPACE => APPPATH,
'App' => APPPATH,
'Michalsn\Minifier' => APPPATH . 'ThirdParty/minifier/src',
];
```
## Configuration

Run command:

> php spark minify:publish

This command will copy a config file to your app namespace.
Then you can adjust it to your needs. By default file will be present in `app/Config/Minifier.php`.
Then you can adjust it to your needs. By default, file will be present in `app/Config/Minifier.php`.

You should define an array of files that you want to minify, ie:

Expand Down Expand Up @@ -104,8 +91,8 @@ Variable | Default value | Options | Desctiption
`$adapterCss` | `\Michalsn\Minifier\Adapters\Css\MinifyAdapter::class` | | Adapter to use for minifying CSS files. You can also implement your own CSS adapter to minify assets and replace this class.
`$dirJs` | `./assets/js` | | JS assets directory.
`$dirCss` | `./assets/css` | | CSS assets directory.
`$dirMinJs` | `null` | | Minified JS Asset Directory.
`$dirMinCss` | `null` | | Minified CSS Asset Directory.
`$dirMinJs` | `null` | | Minified JS asset directory. If not set the value from `$dirJs` will be used instead.
`$dirMinCss` | `null` | | Minified CSS asset directory. If not set the value from `$dirCss` will be used instead.
`$dirVersion` | `./assets` | | Directory to store assets versioning.
`$tagJs` | `<script type="text/javascript" src="%s"></script>` | | JS tag to use in HTML when displaying JS assets.
`$tagCss` | `<link rel="stylesheet" href="%s">` | | CSS tag to use in HTML when displaying CSS assets.
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
],
"license": "MIT",
"require": {
"php" : ">=7.2",
"matthiasmullie/minify": "^1.3"
"php" : ">=7.3",
"matthiasmullie/minify": "^1.3",
"ext-json": "*"
},
"minimum-stability": "dev",
"require-dev": {
"phpunit/phpunit" : "8.5.*",
"codeigniter4/framework": "^4.0.2"
"phpunit/phpunit" : "^8.5",
"codeigniter4/framework": "^4.1"
},
"autoload": {
"psr-4": {
Expand All @@ -38,4 +39,4 @@
"@composer dump-autoload"
]
}
}
}

0 comments on commit 1d5357e

Please sign in to comment.