Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with hoisted packages #270

Closed
FezVrasta opened this issue Dec 11, 2018 · 2 comments · Fixed by #271
Closed

Not working with hoisted packages #270

FezVrasta opened this issue Dec 11, 2018 · 2 comments · Fixed by #271

Comments

@FezVrasta
Copy link
Contributor

FezVrasta commented Dec 11, 2018

I was having a problem with my babel-plugin-macros branch, one of the packages of my monorepo didn't compile with the error:

Error: 'default' is not exported by ../../node_modules/object-assign/index.js

after a bit of tinkering I found out that the problem is this line:

https://github.com/developit/microbundle/blob/master/src/index.js#L359

basically, this line tells rollup-plugin-commonjs to include the local node_modules folder of the current package, but it will not include any hoisted packages (stored at the root node_modules folder).

I tried to change that to **/node_modules/** but it still doesn't work, for now the only working attempt is:

commonjs({
  include: '../../**/node_modules/**',
})

which obviously is not optimal.

I'm quite sure my error could be reproduced even without the additional babel-plugin-macros but I can't figure out how.

Do you think it's worth addressing this issue already?

FezVrasta pushed a commit to FezVrasta/microbundle that referenced this issue Dec 11, 2018
@Andarist
Copy link
Collaborator

include should support regexps, so maybe that would just be simpler to use here?

@FezVrasta
Copy link
Contributor Author

Oh right! I'll send a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants