Closed jfrconley closed 4 years ago
Hi @jfrconley can you provide a MWE such that I can fully understand / fix the problem? Many thanks :beers:!
The easiest way to reproduce is marking aws-sdk as a peer dependency
{
"name": "external-issue",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"parcel": "parcel build -t node --bundle-node-modules --detailed-report --no-source-maps -d bundle src/index.ts"
},
"license": "MIT",
"dependencies": {
"aws-sdk": "^2.561.0"
},
"devDependencies": {
"parcel-bundler": "^1.12.4",
"parcel-plugin-externals": "^0.2.0"
},
"peerDependency": {
"aws-sdk": "*"
}
}
This will cause resolution to fail and parcel-plugin-external to output "module not found".
Relevant snippet from aws-sdk package.json
"browser": {
"lib/aws.js": "./lib/browser.js",
"fs": false, <- Causes failure
"./global.js": "./browser.js",
"./lib/node_loader.js": "./lib/browser_loader.js"
},
Nevermind my previous comment; in your example it was peerDependency
instead of peerDependencies
.
Behavior found. Fix on the way!
Landed in develop
. Please check the 0.3 preview version to see if its fixed! Thanks!
Issue seems to be resolved. Thank you much!
The package.json browser field allows properties to be set to false to exclude files from bundling. However, this causes parcel-plugin-externals to crash as resolve does not accept values other than strings.