Skip to content

Commit

Permalink
fix: disable externals with explicit flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 11, 2022
1 parent ec5db11 commit 2e5de6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/presets/base-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const baseWorker = defineNitroPreset({
entry: null, // Abstract
node: false,
minify: true,
externals: false,
noExternals: true,
inlineDynamicImports: true // iffe does not support code-splitting
})
2 changes: 1 addition & 1 deletion src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const plugins = [
}))

// Externals Plugin
if (nitro.options.externals) {
if (!nitro.options.noExternals) {
rollupConfig.plugins.push(externals(defu(nitro.options.externals as any, {
outDir: nitro.options.output.serverDir,
moduleDirectories: nitro.options.nodeModulesDirs,
Expand Down
3 changes: 2 additions & 1 deletion src/types/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ export interface NitroOptions {
esbuild?: {
options?: EsbuildOptions
}
externals: boolean | NodeExternalsOptions
noExternals: boolean,
externals: NodeExternalsOptions
analyze: false | PluginVisualizerOptions
replace: Record<string, string | ((id: string) => string)>

Expand Down

0 comments on commit 2e5de6c

Please sign in to comment.