Skip to content

Commit be98d35

Browse files
authored
Remove order: 'pre' from resolveId
This causes the plugin to run too early in Vite, preventing any `resolve.alias` from taking effect or for any other plugin to handle node builtins, whether `builtins` or `builtinsPrefix` is set. For example, when you want to polyfill via alias some Node builtins, when building for both browser and Node.js. `enforce: 'pre'` is still needed to run early enough in the Vite plugins order. Which makes `resolveId` already run in the right place in the plugin order. For plain rollup, just place the plugin before other plugins that depend on aliases, for reference, the standard alias plugin doesn't include `order: 'pre'` as well, to allow control such control.
1 parent 15b1a9a commit be98d35

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

source/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ function nodeExternals(options: ExternalsOptions = {}): Plugin {
233233
},
234234

235235
resolveId: {
236-
order: 'pre',
237236
async handler(specifier, importer, { isEntry }) {
238237
if (
239238
isEntry // Ignore entry points (they should always be resolved)

0 commit comments

Comments
 (0)