Skip to content

Not working with hoisted packages #270

@FezVrasta

Description

@FezVrasta

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions