Skip to content

Commit

Permalink
Moving minification options
Browse files Browse the repository at this point in the history
The previous spot is an outdated spot anyways, and it caused an edge-case bug with
resolution of some SASS paths: symfony/demo#586
  • Loading branch information
weaverryan committed Jun 12, 2017
1 parent a60bbdf commit 812edb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/config-generator.js
Expand Up @@ -100,7 +100,7 @@ class ConfigGenerator {
buildRulesConfig() {
const cssLoaders = [
{
loader: 'css-loader' + this.getSourceMapOption(),
loader: 'css-loader' + this.getSourceMapOption()+(this.webpackConfig.isProduction() ? '?minimize=1' : ''),
},
];
if (this.webpackConfig.usePostCssLoader) {
Expand Down Expand Up @@ -292,7 +292,6 @@ class ConfigGenerator {
* https://github.com/jtangelder/sass-loader/issues/285
*/
plugins.push(new webpack.LoaderOptionsPlugin({
minimize: this.webpackConfig.isProduction(),
debug: !this.webpackConfig.isProduction(),
options: {
context: this.webpackConfig.getContext(),
Expand Down
6 changes: 6 additions & 0 deletions test/functional.js
Expand Up @@ -414,13 +414,19 @@ describe('Functional tests using webpack', function() {
const config = createWebpackConfig('www/build', 'production');
config.setPublicPath('/build');
config.addEntry('main', ['./js/no_require']);
config.addEntry('styles', './css/h1_style.css');

testSetup.runWebpack(config, (webpackAssert) => {
// the comment should not live in the file
webpackAssert.assertOutputFileDoesNotContain(
'main.js',
'// comments in no_require.js'
);
// extra spaces should not live in the CSS file
webpackAssert.assertOutputFileDoesNotContain(
'styles.css',
' font-size: 50px;'
);

done();
});
Expand Down

0 comments on commit 812edb2

Please sign in to comment.