Registry / devops / ember-cli-deploy-gzip

ember-cli-deploy-gzip

JSON →
library3.0.0jsnpmunverified

ember-cli-deploy-gzip is a plugin for the Ember CLI Deploy ecosystem, designed to perform in-place gzip compression of static assets as part of a deployment pipeline. Its primary function is to prepare files for upload to asset hosts that expect pre-compressed content, ensuring efficient delivery. The current stable version is 3.0.0, released recently with updated dependencies and Node.js version requirements, maintaining active development. While it does not follow a fixed release cadence, updates are typically driven by Ember CLI or Node.js compatibility needs, or bug fixes. A key differentiator is its seamless integration into the `ember-cli-deploy` workflow, allowing declarative configuration for which file types to compress, including an `ignorePattern` for specific exclusions. It also offers the option to use `node-zopfli` for stronger (though slower) compression. This plugin abstracts away the direct use of compression libraries, providing a higher-level, deployment-focused solution for Ember applications.

devops
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This command integrates the addon into your Ember CLI project's build and deploy pipeline, making it available for configuration.

ember install ember-cli-deploy-gzip

Ember CLI Deploy plugins are configured by their short name ('gzip' in this case) within the `plugins` array of your `config/deploy.js`, not via standard JavaScript module imports.

module.exports = function(deployTarget) { return { plugins: ['gzip'], ... }; };

Specific options for the `gzip` plugin are defined as a top-level property (`gzip`) within the deployment configuration object in `config/deploy.js`.

module.exports = function(deployTarget) { return { gzip: { filePattern: '**/*.{js,css}' }, ... }; };

This quickstart demonstrates how to install `ember-cli-deploy-gzip` and configure it within `config/deploy.js` for an Ember CLI Deploy pipeline, typically alongside `ember-cli-deploy-build` and an asset-upload plugin like `ember-cli-deploy-s3`.

// config/deploy.js module.exports = function(deployTarget) { var ENV = { build: { environment: 'production' }, gzip: { filePattern: '**/*.{js,css,json,ico,map,xml,txt,svg,eot,ttf}', // Default pattern // keep: true, // Example: keep original files and create .gz versions // zopfli: true // Example: use zopfli for stronger compression (requires `node-zopfli` install) } }; if (deployTarget === 'production') { // Example: configure S3 deployment alongside gzip ENV.s3 = { accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '', secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '', bucket: 'your-production-asset-bucket', region: 'us-east-1' }; } // Include the necessary plugins in the deployment pipeline ENV.plugins = ['build', 'gzip', 's3']; // 'build' and 's3' are common companions return ENV; }; // Terminal commands // 1. Ensure prerequisite Ember CLI Deploy plugins are installed (e.g., build, an asset host like s3) // $ ember install ember-cli-deploy-build // $ ember install ember-cli-deploy-s3 // 2. Install this gzip plugin // $ ember install ember-cli-deploy-gzip // 3. Run the deployment // $ AWS_ACCESS_KEY_ID="YOUR_KEY" AWS_SECRET_ACCESS_KEY="YOUR_SECRET" ember deploy production
Debug
Known footguns
breakingVersion 3.0.0 introduced breaking changes, primarily by updating internal dependencies and raising the minimum supported Node.js versions. Users on older Node.js runtimes (prior to 14.x) must upgrade.
gotchaIf the `zopfli` configuration option is set to `true` for stronger compression, the `node-zopfli` package must be manually installed as a development dependency. It is not bundled with `ember-cli-deploy-gzip`.
gotchaCertain file types, particularly image formats like `.png`, `.jpg`, and `.gif`, are already highly compressed and should generally not be gzipped again. Doing so can sometimes increase file size or offer negligible gains.
gotchaThis plugin relies on the `distDir` and `distFiles` properties being present on the deployment `context` object. These are typically provided by the `ember-cli-deploy-build` plugin, which is a common prerequisite.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources