File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -34,24 +34,26 @@ export const bundle: NuxtBuilder['bundle'] = async (nuxt) => {
34
34
} ) )
35
35
36
36
/** Inject rollup plugin for Nitro to handle dynamic imports from webpack chunks */
37
- const nitro = useNitro ( )
38
- const dynamicRequirePlugin = dynamicRequire ( {
39
- dir : resolve ( nuxt . options . buildDir , 'dist/server' ) ,
40
- inline :
37
+ if ( ! nuxt . options . dev ) {
38
+ const nitro = useNitro ( )
39
+ const dynamicRequirePlugin = dynamicRequire ( {
40
+ dir : resolve ( nuxt . options . buildDir , 'dist/server' ) ,
41
+ inline :
41
42
nitro . options . node === false || nitro . options . inlineDynamicImports ,
42
- ignore : [
43
- 'client.manifest.mjs' ,
44
- 'server.js' ,
45
- 'server.cjs' ,
46
- 'server.mjs' ,
47
- 'server.manifest.mjs' ,
48
- ] ,
49
- } )
50
- const prerenderRollupPlugins = nitro . options . _config . rollupConfig ! . plugins as InputPluginOption [ ]
51
- const rollupPlugins = nitro . options . rollupConfig ! . plugins as InputPluginOption [ ]
43
+ ignore : [
44
+ 'client.manifest.mjs' ,
45
+ 'server.js' ,
46
+ 'server.cjs' ,
47
+ 'server.mjs' ,
48
+ 'server.manifest.mjs' ,
49
+ ] ,
50
+ } )
51
+ const prerenderRollupPlugins = nitro . options . _config . rollupConfig ! . plugins as InputPluginOption [ ]
52
+ const rollupPlugins = nitro . options . rollupConfig ! . plugins as InputPluginOption [ ]
52
53
53
- prerenderRollupPlugins . push ( dynamicRequirePlugin )
54
- rollupPlugins . push ( dynamicRequirePlugin )
54
+ prerenderRollupPlugins . push ( dynamicRequirePlugin )
55
+ rollupPlugins . push ( dynamicRequirePlugin )
56
+ }
55
57
56
58
await nuxt . callHook ( `${ builder } :config` , webpackConfigs )
57
59
You can’t perform that action at this time.
0 commit comments