npm install --save-dev restyle-loader
webpack.config.js
{ test: /\.css?$/, use: [ { loader: "restyle-loader" }, { loader: "file-loader", options: { name: "[name].css?[hash:8]" } } ] }
Hash is required to enable HMR
bundle.js
require("./index.css"); // Bundle code here...
index.html
<!-- ... --> <head> <link rel="stylesheet" type="text/css" href="css/index.css"> </head> <!-- ... -->
after the loader runs it becomes
<!-- ... --> <head> <link rel="stylesheet" type="text/css" href="css/index.css?531fdfd0"> </head> <!-- ... -->
© 2012–2016 Tobias Koppers
Licensed under the Creative Commons Attribution License 4.0.
https://webpack.js.org/loaders/restyle-loader/