使用樓主的方式配置刮吧,npm start啟動(dòng)正常许师,通過(guò)http://localhost:3000/index.html和http://localhost:3000/admin.html能訪問(wèn)對(duì)應(yīng)的文件棺榔,但是npm run build報(bào)錯(cuò)端考。(我想說(shuō)的是通過(guò)配置,npm start是有效果的南用,但是npm run build報(bào)錯(cuò))熙卡。報(bào)錯(cuò)信息如下: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學(xué)習(xí)webpack(四) 如何優(yōu)雅的配置多入口訪問(wèn)在大多數(shù)情況底下,我們只需要一個(gè)單頁(yè)應(yīng)用便可以順利的完成許多應(yīng)用場(chǎng)景.但是還是免不了有很多情況下我們需要通過(guò)多頁(yè)才能夠順利的完成任務(wù). 本篇文章就為大家講述如何快速優(yōu)雅的 生...