Skip to content

Commit 3a8be42

Browse files
committed
Remove extra JS output for CSS entry points
Why: Webpack 4 will soon have the ability to handle CSS inputs/outputs natively, but doesn't yet. As a result, when we add our CSS or Sass files as entry points and use the extract text webpack plugin, or the new webpack 4 compatible mini css extract plugin, we'll get bogus, extraneous JS files generated for each of our CSS assets. See [this issue](webpack-contrib/extract-text-webpack-plugin#518) for more details. This change addresses the need by: Using the `rimraf` package to remove the unnecessary files after build.
1 parent 91a02b2 commit 3a8be42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"npm-run-all": "^4.1.1",
2323
"postcss-loader": "^2.0.6",
2424
"reset-css": "^3.0.0",
25+
"rimraf": "^2.6.2",
2526
"sass-loader": "^6.0.6",
2627
"style-loader": "^0.20.3",
2728
"stylelint": "^9.1.3",
@@ -37,9 +38,10 @@
3738
"jquery": "^3.2.1"
3839
},
3940
"scripts": {
41+
"clean-extra": "rimraf distribution/scripts/ie.js distribution/scripts/print.js distribution/scripts/styles.js",
4042
"lint:scss": "stylelint 'source/**/*.scss' --syntax scss --config stylelint.config.js",
4143
"compile": "webpack",
42-
"build": "run-s lint:scss compile",
44+
"build": "run-s lint:scss compile clean-extra",
4345
"start": "webpack --watch"
4446
}
4547
}

0 commit comments

Comments
 (0)