Skip to content

Commit

Permalink
Remove extra JS output for CSS entry points
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ravasthi committed May 23, 2018
1 parent 76b8a31 commit 9f54849
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"npm-run-all": "^4.1.1",
"postcss-loader": "^2.0.6",
"reset-css": "^3.0.0",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"style-loader": "^0.20.3",
"stylelint": "^9.1.3",
Expand All @@ -37,9 +38,10 @@
"jquery": "^3.2.1"
},
"scripts": {
"clean-extra": "rimraf distribution/scripts/ie.js distribution/scripts/print.js distribution/scripts/styles.js",
"lint:scss": "stylelint 'source/**/*.scss' --syntax scss --config stylelint.config.js",
"compile": "webpack",
"build": "run-s lint:scss compile",
"build": "run-s lint:scss compile clean-extra",
"start": "webpack --watch"
}
}

0 comments on commit 9f54849

Please sign in to comment.