Skip to content

Commit

Permalink
improve node polyfill and tslib handling
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Mar 14, 2021
1 parent e9dfbac commit 2570f07
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion esinstall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"resolve": "^1.20.0",
"rimraf": "^3.0.0",
"rollup": "2.37.1",
"rollup-plugin-polyfill-node": "^0.5.0",
"rollup-plugin-polyfill-node": "^0.6.2",
"slash": "^3.0.0",
"validate-npm-package-name": "^3.0.0",
"vm2": "^3.9.2"
Expand Down
2 changes: 1 addition & 1 deletion esinstall/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function generateReplacements(env: Object): {[key: string]: string} {
{
// Other find & replacements:
// tslib: fights with Rollup's namespace/default handling, so just remove it.
'return (mod && mod.__esModule) ? mod : { "default": mod };': 'return mod;',
'mod && mod.__esModule': 'true',
},
);
}
Expand Down
1 change: 1 addition & 0 deletions snowpack/src/sources/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const NEVER_PEER_PACKAGES: string[] = [
'es-abstract',
'node-fetch',
'whatwg-fetch',
'tslib',
];

function isPackageEsm(packageManifest: any): boolean {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12812,10 +12812,10 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0"
inherits "^2.0.1"

rollup-plugin-polyfill-node@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.5.0.tgz#afa87f9105233963b89b0f74a2baaac53ab8a232"
integrity sha512-CYPf4vKeZG5w/Ut7TR1lEMKiBT2pHfj1RLnk92whXKFtT8IGkm+TydwgDNpgTXBCI4V528YijyFVMz4dKcR3AA==
rollup-plugin-polyfill-node@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.6.2.tgz#dea62e00f5cc2c174e4b4654b5daab79b1a92fc3"
integrity sha512-gMCVuR0zsKq0jdBn8pSXN1Ejsc458k2QsFFvQdbHoM0Pot5hEnck+pBP/FDwFS6uAi77pD3rDTytsaUStsOMlA==
dependencies:
"@rollup/plugin-inject" "^4.0.0"

Expand Down

0 comments on commit 2570f07

Please sign in to comment.