Skip to content

Commit ad97d38

Browse files
committed
Tweak order of socketModifyPlugin use
1 parent 28c3ce2 commit ad97d38

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.config/rollup.base.config.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,13 @@ export default function baseConfig(extendConfig = {}) {
258258
return obj
259259
}, {}),
260260
}),
261-
// Convert un-prefixed built-in imports into "node:"" prefixed forms.
262-
replacePlugin({
263-
delimiters: ['(?<=(?:require[$\\w]*\\(|from\\s*)["\'])', '(?=["\'])'],
264-
preventAssignment: false,
265-
values: builtinAliases,
261+
// Remove dangling require calls, e.g. require calls not associated with
262+
// an import binding:
263+
// require('node:util')
264+
// require('graceful-fs')
265+
socketModifyPlugin({
266+
find: /^\s*require[$\w]*\(["'].+?["']\);?\r?\n/gm,
267+
replace: '',
266268
}),
267269
// Replace require calls to ESM 'tiny-colors' with CJS 'yoctocolors-cjs'
268270
// because we npm override 'tiny-colors' with 'yoctocolors-cjs' for dist
@@ -283,13 +285,11 @@ export default function baseConfig(extendConfig = {}) {
283285
)
284286
},
285287
}),
286-
// Remove dangling require calls, e.g. require calls not associated with
287-
// an import binding:
288-
// require('node:util')
289-
// require('graceful-fs')
290-
socketModifyPlugin({
291-
find: /^\s*require[$\w]*\(["'].+?["']\);?\r?\n/gm,
292-
replace: '',
288+
// Convert un-prefixed built-in imports into "node:"" prefixed forms.
289+
replacePlugin({
290+
delimiters: ['(?<=(?:require[$\\w]*\\(|from\\s*)["\'])', '(?=["\'])'],
291+
preventAssignment: false,
292+
values: builtinAliases,
293293
}),
294294
// Reduce duplicate require('node:...') variable assignments.
295295
socketModifyPlugin({

0 commit comments

Comments
 (0)