Skip to content

Commit ecb0b02

Browse files
authored
fix: babel exclude for hoisted modules (#947)
* fix: Ensures hoisted node_modules are excluded by babel * docs: Adding changeset
1 parent 8223eba commit ecb0b02

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/hip-olives-allow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'microbundle': patch
3+
---
4+
5+
Ensures hoisted node_modules are excluded from babel

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ function createConfig(options, entry, format, writeMeta) {
570570
customBabel()({
571571
babelHelpers: 'bundled',
572572
extensions: EXTENSIONS,
573-
exclude: 'node_modules/**',
573+
// use a regex to make sure to exclude eventual hoisted packages
574+
exclude: /\/node_modules\//,
574575
passPerPreset: true, // @see https://babeljs.io/docs/en/options#passperpreset
575576
custom: {
576577
defines,

0 commit comments

Comments
 (0)