使用樓主的方式配置,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(四) 如何優(yōu)雅的配置多入口訪問在大多數(shù)情況底下,我們只需要一個單頁應用便可以順利的完成許多應用場景.但是還是免不了有很多情況下我們需要通過多頁才能夠順利的完成任務. 本篇文章就為大家講述如何快速優(yōu)雅的 生...