We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
环境: Node + Express + VUE-SSR + ... 发现:在development模式下,直接访问 http://localhost:9000/ 时,会直接输出模板生成index.html文件,用production模式下访问正常。 解决:查看 webpack-dev-middleware 源码,发现如果options对象中的index没有配置或为true时会指向index.html,所以需要在setup-dev-server.js 定义webpack-dev-middleware时的options对象参数中增加一个index属性,值为 “/” 即可解决。
// dev middleware const clientCompiler = webpack(clientConfig) const devMiddleware = require('webpack-dev-middleware')(clientCompiler, { publicPath: clientConfig.output.publicPath, noInfo: true, index: "/" //指定index,解决无法直接访问根目的问题 }) app.use(devMiddleware)
有同种业务需要的可以参考(https://github.com/zwlijun/se.vuessr)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
环境: Node + Express + VUE-SSR + ...
发现:在development模式下,直接访问 http://localhost:9000/ 时,会直接输出模板生成index.html文件,用production模式下访问正常。
解决:查看 webpack-dev-middleware 源码,发现如果options对象中的index没有配置或为true时会指向index.html,所以需要在setup-dev-server.js 定义webpack-dev-middleware时的options对象参数中增加一个index属性,值为 “/” 即可解决。
有同种业务需要的可以参考(https://github.com/zwlijun/se.vuessr)
The text was updated successfully, but these errors were encountered: