We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rolldownCjsExternalPlugin
platform: neutral
1 parent ff9dd7f commit d2fc4beCopy full SHA for d2fc4be
packages/vite/src/node/optimizer/rolldownDepPlugin.ts
@@ -315,10 +315,14 @@ export function rolldownCjsExternalPlugin(
315
if (platform === 'node') {
316
return undefined
317
}
318
+ // Skip this plugin for `platform: 'neutral'` as we are not sure whether `require` is available
319
+ if (platform === 'neutral') {
320
+ return undefined
321
+ }
322
323
// Apply this plugin for `platform: 'browser'` as `require` is not available in browser and
324
// converting to `import` would be necessary to make the code work
- platform satisfies 'browser' | 'neutral'
325
+ platform satisfies 'browser'
326
327
const filter = new RegExp(externals.map(matchesEntireLine).join('|'))
328
0 commit comments