mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 03:41:28 +00:00
fix: mark Node.js built-in modules as external in rollup config (#7095)
Use `isBuiltin` from the `module` package to dynamically exclude all Node.js built-in modules from the bundle, preventing rollup from trying to bundle core modules like path, fs, crypto, etc. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ const dts = require('rollup-plugin-dts');
|
||||
const { terser } = require('rollup-plugin-terser');
|
||||
const peerDepsExternal = require('rollup-plugin-peer-deps-external');
|
||||
const json = require('@rollup/plugin-json');
|
||||
const { isBuiltin } = require('module');
|
||||
const packageJson = require('./package.json');
|
||||
|
||||
module.exports = [
|
||||
@@ -38,6 +39,6 @@ module.exports = [
|
||||
typescript({ tsconfig: './tsconfig.json' }),
|
||||
terser()
|
||||
],
|
||||
external: ['axios', 'qs', 'ws', 'debug']
|
||||
external: (id) => isBuiltin(id) || ['axios', 'qs', 'ws', 'debug'].includes(id)
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user