Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5054

What is "same filename error" for webpack?

$
0
0

I get this error when ı run webpack production mode "Multiple assets emit different content to the same filename index.html" but ı didn't understand. Looks like ı don't add multiple index.html outputs. this is my webpack.config.js file. Also, ı can use react.

const HtmlWebpackPlugin = require("html-webpack-plugin");const path = require("path");const MiniCssExtractPlugin = require("mini-css-extract-plugin");module.exports = {  output: {    path: path.join(__dirname, "/dist"),    filename: "index.bundle.js",    publicPath: "/",  },  devServer: {    port: 3010,    watchContentBase: true,  },  entry: ["@babel/polyfill", "./src/index.js"],  module: {    rules: [      {        test: /\.(js|jsx)$/,        exclude: /node_modules/,        use: {          loader: "babel-loader",        },      },      {        test: /\.scss$/,        use: [          {            loader: "style-loader",          },          {            loader: "css-loader",          },          {            loader: "sass-loader",          },        ],      },      {        test: /\.(png|jpg)$/,        loader: "url-loader",      },    ],  },  devServer: {    historyApiFallback: true,  },  plugins: [    new MiniCssExtractPlugin(),    new HtmlWebpackPlugin(),  ],};

Edit: When ı remove HtmlWebpackPlugin this error destroyed. What is there a problem with this plugin?


Viewing all articles
Browse latest Browse all 5054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>