webpack-dev-server 呈现所有 js 文件,但在加载时抛出 404
webpack-dev-server renders all js files, but throws 404 on load
我的环境运行良好,但突然出现这种情况。
该页面包含一些脚本 'images.js' 'polyfill.js' 'vendor.js'
当 运行 webpack 服务器时,一切正常启动(绿色 'rendered' 消息)。但是当打开页面时(index.html 可用),在加载引用的脚本时,我只在输出 window.
中得到 404
在我看来,服务器启动时出现构建错误,但没有错误输出。有什么方法可以查看 'deeper' 服务器在启动时的运行情况吗?
感谢Github上的大佬们,我终于解决了。事实证明,运行 Webpack 服务器在 Windows 10(我的同事一切正常)和 Windows Server 2008(我正在使用)上的行为有所不同。将网络服务器配置中的 'publicPath' 设置为 http://localhost:3000/ 解决了它。
我的环境运行良好,但突然出现这种情况。
该页面包含一些脚本 'images.js' 'polyfill.js' 'vendor.js'
当 运行 webpack 服务器时,一切正常启动(绿色 'rendered' 消息)。但是当打开页面时(index.html 可用),在加载引用的脚本时,我只在输出 window.
中得到 404在我看来,服务器启动时出现构建错误,但没有错误输出。有什么方法可以查看 'deeper' 服务器在启动时的运行情况吗?
感谢Github上的大佬们,我终于解决了。事实证明,运行 Webpack 服务器在 Windows 10(我的同事一切正常)和 Windows Server 2008(我正在使用)上的行为有所不同。将网络服务器配置中的 'publicPath' 设置为 http://localhost:3000/ 解决了它。