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

Bundling fails when react-dom@17.x is added to external #24

Closed Devil7DK closed 4 years ago

Devil7DK commented 4 years ago

When adding react-dom@17.x to externals bundling is failing due to the specified module doesn't exist.

× ENOENT: no such file or directory, lstat 'C:\Users\<...>\node_modules\react-dom\unstable-fizz.browser.js' at realpathSync (fs.js:1476:7) at externals.push.modules.map (C:\Users\<...>\node_modules\parcel-plugin-externals\utils.js:165:15) at Array.map () at makeResolver (C:\Users\<...>\node_modules\parcel-plugin-externals\utils.js:163:18) at combineExternalsPrimitive (C:\Users\<...>\node_modules\parcel-plugin-externals\utils.js:201:12) at combineExternals (C:\Users\<...>\node_modules\parcel-plugin-externals\utils.js:210:18) at retrieveExternals (C:\Users\<...>\node_modules\parcel-plugin-externals\utils.js:257:14) at module.exports (C:\Users\<...>\node_modules\parcel-plugin-externals\index.js:9:21) at Bundler.loadPlugins (C:\Users\<...>\node_modules\parcel\src\Bundler.js:219:17)

In package.json of react-dom:

"browser": { "./server.js": "./server.browser.js", "./unstable-fizz.js": "./unstable-fizz.browser.js" },

In such cases i.e. when referenced module doesn't exist makeResolver function breaks.

FlorianRappl commented 4 years ago

Landed in 0.5.2. Thanks for your contribution! 🍻