|
1 | 1 | # ember-cli-deploy-gzip |
2 | 2 |
|
3 | | -NOTE: This plugin targets ember-cli-deploy 0.5.0 and later. 0.5.0 is in development at this time. |
| 3 | +> An ember-cli-deploy plugin to compress files in-place using gzip compression |
4 | 4 |
|
5 | | -This ember-cli-deploy plugin compresses files in-place using gzip compression. |
| 5 | +<hr/> |
| 6 | +**WARNING: This plugin is only compatible with ember-cli-deploy versions >= 0.5.0** |
| 7 | +<hr/> |
6 | 8 |
|
7 | | -This is helpful to prepare for upload to a asset host that expects files to be |
8 | | -pre-compressed. |
| 9 | +This plugin compresses files in-place using gzip compression. This is helpful to prepare for upload to an asset host that expects files to be pre-compressed. |
| 10 | + |
| 11 | +## What is an ember-cli-deploy plugin? |
| 12 | + |
| 13 | +A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks. |
| 14 | + |
| 15 | +For more information on what plugins are and how they work, please refer to the [Plugin Documentation][1]. |
| 16 | + |
| 17 | +## Quick Start |
| 18 | + |
| 19 | +To get up and running quickly, do the following: |
| 20 | + |
| 21 | +- Ensure [ember-cli-deploy-build][2] is installed and configured. |
| 22 | + |
| 23 | +- Install this plugin |
| 24 | + |
| 25 | +```bash |
| 26 | +$ ember install ember-cli-deploy-gzip |
| 27 | +``` |
| 28 | + |
| 29 | +- Run the pipeline |
| 30 | + |
| 31 | +```bash |
| 32 | +$ ember deploy |
| 33 | +``` |
9 | 34 |
|
10 | 35 | ## Installation |
11 | 36 |
|
12 | | -* `ember install ember-cli-deploy-gzip` |
| 37 | +Run the following command in your terminal: |
| 38 | + |
| 39 | +```bash |
| 40 | +ember install ember-cli-deploy-gzip |
| 41 | +``` |
13 | 42 |
|
14 | 43 | ## ember-cli-deploy Hooks Implemented |
15 | 44 |
|
16 | | -* configure |
17 | | -* willUpload |
| 45 | +For detailed information on what plugin hooks are and how they work, please refer to the [Plugin Documentation][1]. |
| 46 | + |
| 47 | +- `configure` |
| 48 | +- `willUpload` |
| 49 | + |
18 | 50 |
|
19 | 51 | ## Configuration Options |
20 | 52 |
|
| 53 | +For detailed information on how configuration of plugins works, please refer to the [Plugin Documentation][1]. |
| 54 | + |
21 | 55 | ### filePattern |
22 | 56 |
|
23 | 57 | Files matching this pattern will be gzipped. |
24 | 58 |
|
25 | | -_Default:_ "\*\*/\*.{js,css,png,gif,jpg,map,xml,txt,svg,eot,ttf,woff,woff2}" |
| 59 | +*Default:* `'\*\*/\*.{js,css,png,gif,jpg,map,xml,txt,svg,eot,ttf,woff,woff2}'` |
26 | 60 |
|
27 | 61 | ### distDir |
28 | 62 |
|
29 | | -Directory where assets have been written to |
| 63 | +The root directory where the files matching `filePattern` will be searched for. By default, this option will use the `distDir` property of the deployment context, provided by [ember-cli-deploy-build][2]. |
30 | 64 |
|
31 | | -_Default:_ the `distDir` property of the deployment context |
| 65 | +*Default:* `context.distDir` |
32 | 66 |
|
33 | 67 | ### distFiles |
34 | 68 |
|
35 | | -The Array of built assets. |
| 69 | +The list of built project files. This option should be relative to `distDir` and should include the files that match `filePattern`. By default, this option will use the `distFiles` property of the deployment context, provided by [ember-cli-deploy-build][2]. |
36 | 70 |
|
37 | | -_Default:_ the `distFiles` property of the deployment context |
| 71 | +*Default:* `context.distDir` |
38 | 72 |
|
39 | 73 | ### zopfli |
40 | 74 |
|
41 | | -Use node-zopfli for compression (better than regular gzip |
42 | | -compression, but slower). If you set this to `true`, you |
43 | | -will need to `npm install node-zopfli --save-dev` in your app. |
| 75 | +Use node-zopfli for compression (better than regular gzip compression, but slower). |
| 76 | + |
| 77 | +If set to `true`, you will need to `npm install node-zopfli --save-dev` in your app. |
44 | 78 |
|
45 | | -_Default:_ false |
| 79 | +*Default:* `false` |
46 | 80 |
|
47 | 81 | ## Prequisites |
48 | 82 |
|
49 | | -The default configuration of this plugin expects the deployment context to have `distDir` and `distFiles` properties. These are conveniently created by the [ember-cli-deploy-build](https://github.com/zapnito/ember-cli-deploy-build) plugin so will work out of the box if you are using that plugin. |
| 83 | +The following properties are expected to be present on the deployment `context` object: |
| 84 | + |
| 85 | +- `distDir` (provided by [ember-cli-deploy-build][2]) |
| 86 | +- `distFiles` (provided by [ember-cli-deploy-build][2]) |
50 | 87 |
|
51 | 88 | ## Plugins known to work well with this one |
52 | 89 |
|
53 | | -[ember-cli-deploy-build](https://github.com/zapnito/ember-cli-deploy-build) |
54 | | -[ember-cli-deploy-s3](https://github.com/zapnito/ember-cli-deploy-s3) |
| 90 | +[ember-cli-deploy-build][2] |
| 91 | +[ember-cli-deploy-s3][3] |
55 | 92 |
|
56 | 93 | ## Running Tests |
57 | 94 |
|
58 | | -* `npm test` |
| 95 | +- `npm test` |
| 96 | + |
| 97 | +[1]: http://ember-cli.github.io/ember-cli-deploy/plugins "Plugin Documentation" |
| 98 | +[2]: https://github.com/zapnito/ember-cli-deploy-build "ember-cli-deploy-build" |
| 99 | +[3]: https://github.com/zapnito/ember-cli-deploy-s3 "ember-cli-deploy-s3" |
0 commit comments