diff --git a/.changeset/hip-olives-allow.md b/.changeset/hip-olives-allow.md new file mode 100644 index 00000000..fd808e26 --- /dev/null +++ b/.changeset/hip-olives-allow.md @@ -0,0 +1,5 @@ +--- +'microbundle': patch +--- + +Ensures hoisted node_modules are excluded from babel diff --git a/src/index.js b/src/index.js index f2ed30b0..c483152c 100644 --- a/src/index.js +++ b/src/index.js @@ -570,7 +570,8 @@ function createConfig(options, entry, format, writeMeta) { customBabel()({ babelHelpers: 'bundled', extensions: EXTENSIONS, - exclude: 'node_modules/**', + // use a regex to make sure to exclude eventual hoisted packages + exclude: /\/node_modules\//, passPerPreset: true, // @see https://babeljs.io/docs/en/options#passperpreset custom: { defines,