简体   繁体   English

如何更改 nuxt/webpack 尝试从中获取后续块的地址?

[英]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.

相关问题 如何让 webpack-dev-server 停止使用 React 惰性/Suspense 代码拆分来停止下载内容更改时不正确的块? - How can I get webpack-dev-server to stop downloading incorrect chunks on content change with React lazy/Suspense code splitting? 如何更改 _nuxt 文件夹的名称? - How can I change the name of the _nuxt folder? 我从 webpack 4 迁移到 webpack 5 但我的块比以前大 - I migrated from webpack 4 to webpack 5 but my chunks are bigger than before 我的 Webpack 供应商包大小非常大(几乎 2 MB),我怎样才能制作多个供应商块 - My Webpack vendor bundle size is very large (Almost 2 MB), how can I make multiple vendor chunks [Webpack] [反应]在具有代码拆分功能的SSR上,如何获取页面所需的块列表? - [Webpack][React] On SSR with code-splitting how I can get the list of chunks needed by the page? 如何从webpack中的异步块中分离节点模块? - How to separate node modules from async chunks in webpack? 如何正确压缩 webpack 块? - How to properly compress webpack chunks? 如何将后端从当前的webpack开发服务器更改为Express? - How can I change my backend from the current webpack dev server to express? 如何减少包含AWS开发工具包的Vue.js / Nuxt.js项目的webpack捆绑包大小? - How can I reduce the webpack bundle size for a Vue.js / Nuxt.js project incorporating AWS SDK? 如何更改延迟加载Angular 2查找块的位置? - How can I change where lazy-loading Angular 2 looks for chunks?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM