Skip to content

Commit

Permalink
fix: babel exclude for hoisted modules (#947)
Browse files Browse the repository at this point in the history
* fix: Ensures hoisted node_modules are excluded by babel

* docs: Adding changeset
  • Loading branch information
rschristian committed Apr 21, 2022
1 parent 8223eba commit ecb0b02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-olives-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'microbundle': patch
---

Ensures hoisted node_modules are excluded from babel
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ecb0b02

Please sign in to comment.