diff --git a/esinstall/package.json b/esinstall/package.json index 57539633d2..cd559786c7 100644 --- a/esinstall/package.json +++ b/esinstall/package.json @@ -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" diff --git a/esinstall/src/index.ts b/esinstall/src/index.ts index f0d3888e6d..d26c7d9aa7 100644 --- a/esinstall/src/index.ts +++ b/esinstall/src/index.ts @@ -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', }, ); } diff --git a/snowpack/src/sources/local.ts b/snowpack/src/sources/local.ts index d1a8234559..055ceea304 100644 --- a/snowpack/src/sources/local.ts +++ b/snowpack/src/sources/local.ts @@ -49,6 +49,7 @@ const NEVER_PEER_PACKAGES: string[] = [ 'es-abstract', 'node-fetch', 'whatwg-fetch', + 'tslib', ]; function isPackageEsm(packageManifest: any): boolean { diff --git a/yarn.lock b/yarn.lock index 9b6b20ee25..052288ff5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"