FlorianRappl / parcel-plugin-externals

Parcel plugin for declaring externals. These externals will not be bundled. :package:
https://piral.io
MIT License
47 stars 3 forks source link

Ignores hoisted modules #10

Closed 4lejandrito closed 4 years ago

4lejandrito commented 4 years ago

Hi!

I am happy user of your plugin. However I am trying to move a site using it to a package inside a monorepo that uses lerna + yarn workspaces.

With this setup all the dependencies are hoisted. This means the paths passded by parcel will be different from the ones calculated by this plugin and the external modules will not be externalized.

I've created a sample repo where you can see the issue in action: https://github.com/4lejandrito/parcel-plugin-externals-yarn-workspaces-issue-demo.

Run yarn && yarn start on it and you'll get a page that should have a dependency externalized (and therefore fail) but it will actually exist in the bundle and print a message on the screen.

FlorianRappl commented 4 years ago

Wonderful catch. Much appreciated (and the PR even more)!