Hi I'm a fairly new programmer in webpack, I am trying to create react app using webpack. but i am getting this error.
Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = ./index.html
[![const HtmlWebPackPlugin = require("html-webpack-plugin");
const path = require('path')
const htmlPlugin = new HtmlWebPackPlugin({
template: "./src/index.html",
filename: "./index.html"
});
module.exports = {
entry: "index.js",
output: {
path: path.resolve('dist'),
filename: 'bundle.js'
},
module: {
rules: \[
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
"presets": \["env", "react"\]
}
}
}
\]
},
plugins: \[htmlPlugin\],
devServer: {
contentBase: './dist',
hot: true
}
};
Maybe filename: "./index.html"
should be filename: "index.html"
? Or just remove it
似乎此错误消息是无害的,可以忽略: html-webpack-plugin问题#895
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.