1

I have a project without javascript but would like to use webpack 4 and postcss. Every time I run webpack --mode development, a "style.js" is automatically created in the ./dist folder.

How can I prevent this?

webpack.config.js:

module.exports = {
 entry: { style: "./src/8px.css" },
 output: {
   path: path.resolve(__dirname, "dist")
 },
 plugins: [
   new MiniCssExtractPlugin({
     filename: "8px.css"
   })
 ],
 module: {
   rules: [
     {
       test: /\.css$/,
       use: [
         MiniCssExtractPlugin.loader,
         { loader: "css-loader", options: { importLoaders: 1 } },
         "postcss-loader"
       ]
     }
   ]
 }

};

Jan
  • 43
  • 1
  • 7

1 Answers1

0

you can use webpack-shell-plugin to automatically remove that style.js for you.

loveky
  • 1,002
  • 1
  • 11
  • 18