Version
- Getting started
- Overview
- Installation
- Quick start
- The Deploy Pipeline
- Overview
- Pipeline Hooks
- The Deployment Context
- Plugins
- Overview
- Plugins
- Plugin Packs
- Writing a plugin
- Configuration
- Overview
- Aliasing Plugins
- dotEnv Support
- Fingerprinting
- Default CLI Options
- Usage
- Overview
- Development Workflow
- Deployment Strategies
- Overview
- The Lightning Strategy
- Examples
- S3 walkthrough
- Lightning Strategy
- Upgrading
- Apps
- Plugins
Improve this page
Fingerprinting
Usage
ember-cli
comes with fingerprinting support built-in.
In most production scenarios you will need to provide a prepend
-property to your
app’s fingerprint-property (to reference your CDN served assets correctly).
// ember-cli-build.js
var app = new EmberApp(defaults, {
fingerprint: {
prepend: 'https://subdomain.cloudfront.net/'
}
});
This is especially useful when you’re pushing your assets to a cloud service like Amazon S3 but serving your index.html
from a different location as you need to use absolute urls.
Managing multiple environments
ember-cli
will only create a production like build for the
production
-environment by default. If you want to support multiple
‘production-like’ environments you need to configure minification for these
environments manually.
You can do something like this:
// ember-cli-build.js
var env = EmberApp.env();
var isProductionLikeBuild = ['production', 'staging'].indexOf(env) > -1;
var app = new EmberApp(defaults, {
fingerprint: {
enabled: isProductionLikeBuild,
prepend: 'https://subdomain.cloudfront.net/'
},
sourcemaps: {
enabled: !isProductionLikeBuild,
},
minifyCSS: { enabled: isProductionLikeBuild },
minifyJS: { enabled: isProductionLikeBuild },
tests: process.env.EMBER_CLI_TEST_COMMAND || !isProductionLikeBuild,
hinting: process.env.EMBER_CLI_TEST_COMMAND || !isProductionLikeBuild,
});