嗨,我是webpack中的一名相当新的程序员,我正在尝试使用webpack创建react应用。但我收到此错误。
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
}
};
答案 0 :(得分:0)
也许filename: "./index.html"
应该是filename: "index.html"
吗?
或者只是将其删除
答案 1 :(得分:0)
似乎此错误消息是无害的,可以忽略:html-webpack-plugin issue #895