我在github上运行Angular4 Webpack启动器样板代码(location => https://github.com/AngularClass/angular-starter)。
在使用“npm start”命令运行应用程序时,应用程序而不是打开http://localhost:3000浏览器,打开文件位置http://c/Users/Public/。另外,我在控制台上看到下面令人困惑的陈述(见最后2行“内容不是来自webpack **”和“404s将后退**”)
不确定为什么webpack正在打开文件位置&如何解决日志中的歧义。 (请注意,如果我在http://localhost:3000示例中手动输入,请继续工作。)
10% building modules 2/2 modules 0 active
Project is running at http://C:\Users\Public/
webpack output is served from /
Content not from webpack is served from C:\wrksp\code\AngularTS\WebpackStarter\src
404s will fallback to /index.html
答案 0 :(得分:2)
删除config/webpack.dev.js
上的以下行:
const PUBLIC = process.env.PUBLIC || undefined;
public: PUBLIC,
public: METADATA.public,
它会起作用。
您可以找到报告的问题here