简体   繁体   English

入口点未定义= ./index.html

[英]Entrypoint undefined = ./index.html

Hi I'm a fairly new programmer in webpack, I am trying to create react app using webpack. 嗨,我是webpack的一名相当新的程序员,我正在尝试使用webpack创建react应用。 but i am getting this error. 但我收到此错误。


Error 错误

Child html-webpack-plugin for "index.html":
1 asset
Entrypoint undefined = ./index.html

webpack.config.js webpack.config.js

[![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
    }
  };

This is My Project structure 这是我的项目结构

[ https://i.stack.imgur.com/ve1oa.png] [ https://i.stack.imgur.com/ve1oa.png]

Maybe filename: "./index.html" should be filename: "index.html" ? 也许filename: "./index.html" filename: "index.html"应该是filename: "index.html" Or just remove it 或者只是删除它

似乎此错误消息是无害的,可以忽略: html-webpack-plugin问题#895

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM