Skip to content

Commit

Permalink
fix(nuxt): Only wrap .mjs entry files in rollup (#14060)
Browse files Browse the repository at this point in the history
fixes #14057

`@nuxt/content` adds entry files to rollup. This fix adds a check for
`.mjs` to ignore other files in the rollup plugin.
  • Loading branch information
s1gr1d authored Oct 23, 2024
1 parent 6cee1bf commit 8a68fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/vite/addServerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function wrapEntryWithDynamicImport(resolvedSentryConfigPath: string): InputPlug
return { id: source, moduleSideEffects: true, external: true };
}

if (options.isEntry && !source.includes(`.mjs${SENTRY_WRAPPED_ENTRY}`)) {
if (options.isEntry && source.includes('.mjs') && !source.includes(`.mjs${SENTRY_WRAPPED_ENTRY}`)) {
const resolution = await this.resolve(source, importer, options);

// If it cannot be resolved or is external, just return it so that Rollup can display an error
Expand Down

0 comments on commit 8a68fa9

Please sign in to comment.