如何使用webpack开发服务器获取webpack多入口点示例?
我一直在努力让这个示例项目与WebpackDevServer一起工作 因此,我期望发生的是,在我提供它之后,我可以转到如何使用webpack开发服务器获取webpack多入口点示例?,webpack,webpack-dev-server,Webpack,Webpack Dev Server,我一直在努力让这个示例项目与WebpackDevServer一起工作 因此,我期望发生的是,在我提供它之后,我可以转到localhost:8080/pageA和localhost:8080/pageB查看我的不同入口点 我设置了我的包.json如下: { "name": "multiple-entry-points", "version": "1.0.0", "description": "This example shows how to use multiple entry p
localhost:8080/pageA
和localhost:8080/pageB
查看我的不同入口点
我设置了我的包.json
如下:
{
"name": "multiple-entry-points",
"version": "1.0.0",
"description": "This example shows how to use multiple entry points with a commons chunk.",
"main": "build.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^3.2.0",
"webpack-dev-server": "^2.5.1"
}
}
我试着这样运行它:
node_modules/.bin/webpack-dev-server --inline --content-base ./public
(如果不输入--inline等,我只会得到一个目录列表)
不走运localhost:8080/pageA
不起作用,等等。我甚至不确定我的期望是否正确
任何指导都将不胜感激 没有url
localhost:8080/pageA
和localhost:8080/pageB
有js
bundlepageA.js
和pageB.js
您可能需要打开urllocalhost:8080/pageA.html
和localhost:8080/pageAB.html
入口点是js
bundle。您需要将其包含在html页面中,如下所示:
我尝试访问,但我无法访问/pageA.html。这个例子坏了吗?