简体   繁体   English

构建 REACT 项目错误消息(“index.html”= index.html 的入口点 html-webpack-plugin)

[英]Building REACT Project Error Message (Entrypoint html-webpack-plugin for "index.html" = index.html)

I'm unable to build my react project using npm run build as I keep getting the error message below:我无法使用npm run build构建我的npm run build项目,因为我不断收到以下错误消息:

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

I'm fairly new to building react projects so apologies if this is an amateur question.我对构建 React 项目还很陌生,如果这是一个业余问题,我深表歉意。 What I've tried already:我已经尝试过的:

  1. I've tried changing the entry point by following this html-webpack-plugin Entrypoint undefined = index.html but it still hasn't worked.我已经尝试按照这个html-webpack-plugin Entrypoint undefined = index.html更改入口点,但它仍然没有工作。

  2. I've attempted downgrading webpack to 3.07 as well but that solution didn't help either.我也尝试将 webpack 降级到3.07 ,但该解决方案也无济于事。

  3. I've tried other options including npm i mishoo/UglifyJS2#harmony in terminal as pointed out here: https://github.com/webpack/webpack-pwa/issues/7 but still no luck我已经尝试了其他选项,包括npm i mishoo/UglifyJS2#harmony在终端中指出: https : //github.com/webpack/webpack-pwa/issues/7但仍然没有运气

I currently can't think of any other solution thus I decided to post here.我目前想不出任何其他解决方案,因此我决定在这里发布。

My webpack is located in: internals/webpack/webpack.prod.babel我的 webpack 位于: internals/webpack/webpack.prod.babel

My index.html is located in the root folder我的index.html位于根文件夹中

In my package.json, I have webpack as follows:在我的 package.json 中,我有 webpack 如下:

"devDependencies": {
 "html-webpack-plugin": "3.0.7",
...
}

I'd totally appreciate help to help resolve this issue.我非常感谢帮助解决这个问题。 Thanks in advance everyone.提前谢谢大家。

npm run build will work only if you specify what needs to be done for build in the package.json file.只有当您在 package.json 文件中指定构建所需的内容时, npm run build才会起作用。 but if your intension is just to install packages(ie first step) run " npm install " and to run the code run " npm start "但是如果您的意图只是安装软件包(即第一步),请运行“ npm install ”并运行代码运行“ npm start

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

相关问题 Webpack 用于创建索引的 html-webpack-plugin 配置错误。html - Webpack config error with html-webpack-plugin for creating index.html 使用html-webpack-plugin在Webpack中生成index.html文件(使用vue-simple样板的项目) - Using html-webpack-plugin to generate an index.html file in Webpack (project using vue-simple boilerplate) HtmlWebpackPlugin - 错误中的错误:加载程序“[...]/html-webpack-plugin - /lib/loader.js!/[...]/src/index.html”没有返回 html - HtmlWebpackPlugin - ERROR in Error: The loader "[...]/html-webpack-plugin - /lib/loader.js!/[...]/src/index.html" didn't return html 使用webpack-dev-server时,html-webpack-plugin不会将js文件注入index.html - html-webpack-plugin not inject js file into index.html when using webpack-dev-server HTML Webpack插件未创建正确的index.html文件 - HTML Webpack Plugin not creating correct index.html file Webpack 5 不会在 index.html 的 div 上注入反应代码 - Webpack 5 does not inject react-code on div in index.html 使用webpack访问index.html中的环境变量 - Access environment variables in index.html with webpack Webpack 服务未将 JS 插入索引。html - Webpack Serve not inserting JS into index.html webpack,处理index.html中的env变量 - webpack, process env variable in index.html Webpack 开发服务器未找到索引。html - Webpack dev server not finding index.html
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM