使用楼主的方式配置,npm start启动正常,通过http://localhost:3000/index.html和http://localhost:3000/admin.html能访问对应的文件,但是npm run build报错。(我想说的是通过配置,npm start是有效果的,但是npm run build报错)。报错信息如下:Creating an optimized production build...
Failed to compile.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry should be one of these:
function | object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string]
-> The entry point(s) of the compilation.
Details:
* configuration.entry should be an instance of function
-> A Function returning an entry object, an entry string, an entry array or a promise to these things.
* configuration.entry['index'] should be a string.
-> The string is resolved to a module which is loaded upon startup.
* configuration.entry['index'][0] should be a string.
-> A non-empty string
* configuration.entry['mobile'] should be a string.
-> The string is resolved to a module which is loaded upon startup.
* configuration.entry['mobile'][0] should be a string.
-> A non-empty string
* configuration.entry should be a string.
-> An entry point without name. The string is resolved to a module which is loaded upon startup.
* configuration.entry should be an array:
[non-empty string]
从create-react-app学习webpack(四) 如何优雅的配置多入口访问在大多数情况底下,我们只需要一个单页应用便可以顺利的完成许多应用场景.但是还是免不了有很多情况下我们需要通过多页才能够顺利的完成任务. 本篇文章就为大家讲述如何快速优雅的 生...