[英]How can I change the address nuxt/webpack is attempting to fetch subsequent chunks from?
My controller serves my nuxt app through another app's controller.我的 controller 通过另一个应用程序的 controller 为我的 nuxt 应用程序提供服务。 eg hitting https://google.com/my-address will actually reach out to a nuxt app hosted at https://custom-address/.
例如,点击https://google.com/my-address将实际访问托管在 https://custom-address/ 的 nuxt 应用程序。 The initial load returns the server side render html and successfully hydrates the page by fetching the appropriate bundles from https://custom-address.
初始加载返回服务器端渲染 html 并通过从 https://custom-address 获取适当的捆绑包成功地水合页面。 However, subsequent navigation ( https://google.com/my-address/another-address/ ) will attempt to fetch bundles from https://google.com/_nuxt/ instead of https://custom-address.
但是,后续导航( https://google.com/my-address/another-address/ )将尝试从https://google.com/_nuxt/而不是 Z5E056C500A1C4B6A71110-custom-B Is there a way to configure this address in webpack/nuxt?
有没有办法在 webpack/nuxt 中配置这个地址? I assume this would be a webpack specific configuration, but perhaps nuxt has a configuration for it as well.
我认为这将是 webpack 特定配置,但也许 nuxt 也有它的配置。 Thanks in advance!
提前致谢!
You can configure the address where bundles are being served from with this nuxt.config.js
setting: https://nuxtjs.org/docs/configuration-glossary/configuration-build/#publicpath .您可以使用以下
nuxt.config.js
设置配置提供捆绑包的地址: https://nuxtjs.org/docs/configuration-glossary/configuration-build/#publicpath 。 A common use case for this would be serving your bundles through a cdn.一个常见的用例是通过 CDN 为您的包提供服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.