-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minifyJS.enabled option in ember-cli-build not working #7445
Comments
@cdatehortuab just to be clear, your // ember-cli-build.js
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
minifyJS: {
enabled: true
}
});
//...
return app.toTree();
}; and it doesn't minify files? |
@twokul No, it doesn't. It is as if it was only taking into account the environment for which I'm building and not my config. |
@cdatehortuab can you put together a reproduction? |
First this is the output of
I generated a new ember project with // ember-cli-build.js
/* eslint-env node */
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
minifyJS: {
enabled: true
}
});
return app.toTree();
}; After that I ran Then, I changed the // ember-cli-build.js
/* eslint-env node */
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
minifyJS: {
enabled: false
}
});
return app.toTree();
}; And when I ran So that option is being ignored by ember-cli. I hope it was clear. Greetings, thanks. |
I went ahead and created a minimal example verifying the issue. Clone the repo, run |
I believe this is related to the following change in the ember-cli/broccoli-terser-sourcemap#49 Based on this, the however I believe the plugin now expects a different format. The following /* eslint-env node */
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
/*
* this looks to be broken!
minifyJS: {
enabled: false
},
*/
'ember-cli-uglify': {
enabled: true,
uglify: {
// compress: true,
// sourceMap: true,
mangle: false, // defaults to true
}
},
});
return app.toTree();
}; |
@axiomabsolute thanks for investigating this. could you open an issue on the https://github.com/ember-cli/broccoli-uglify-sourcemap/issues repo for this? and if you have a bit of time it would be awesome if you could come up with a failing test for it that reproduces the problem. |
Has anyone investigated this issue further? I've run into the same issue today and it's been half year since this issue was submitted. It would be nice to update ember-cli docs, what do you think? |
another ping! Trying to debug some issues that only occur in production and wanting to ship unminified, fingerprinted assets. ember-cli (or broccoli-uglify-sourcemaps?) is not respecting |
@ultimatemonty have a look at https://github.com/ember-cli/ember-cli-uglify#usage. it describes how to disable the JS minification step. |
Closing as no longer relevant due to the migration from uglify to terser. |
Hello,
I'm having an issue when build my ember project.
The problem is that ember-cli is ignoring the minifyJS.enabled option.
It only takes into account the environment, not my custom option.
If I build for 'development', using in my ember-cli-build.js file:
minifyJS: { enabled: true },
,the JavaScript files should be minified but they are not.
And, if I build for 'production', using in my ember-cli-build.js file:
minifyJS: { enabled: false },
,the JavaScript files should not be minified but they are.
Thanks.
Output from
ember version --verbose && npm --version && yarn --version
:The text was updated successfully, but these errors were encountered: