Skip to content

Commit

Permalink
Make Symbol work in IE10-11 (kinda xD)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Oct 3, 2019
1 parent fc7c397 commit 0c83dbc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"rollup": "^1.10.1",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-license": "^0.8.1",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.21.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/browser/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import typescript from 'rollup-plugin-typescript2';
import license from 'rollup-plugin-license';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import modify from 'rollup-plugin-modify';

const commitHash = require('child_process')
.execSync('git rev-parse --short HEAD', { encoding: 'utf-8' })
Expand Down Expand Up @@ -46,6 +47,11 @@ const plugins = [
mainFields: ['module'],
}),
commonjs(),
modify({
// It's very difficult to use Symbol without polyfilling in IE10 and still making TypeScript behave correctly.
// Just remove it and leave this space in there, so that SourceMaps are still correct.
"this[Symbol.toStringTag] = '[object SyncPromise]';": ' ',
}),
];

const bundleConfig = {
Expand Down
29 changes: 22 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7192,20 +7192,20 @@ magic-string@0.25.1, magic-string@^0.25.1:
dependencies:
sourcemap-codec "^1.4.1"

magic-string@0.25.2, magic-string@^0.25.2:
version "0.25.2"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9"
integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==
dependencies:
sourcemap-codec "^1.4.4"

magic-string@^0.19.0:
version "0.19.1"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.19.1.tgz#14d768013caf2ec8fdea16a49af82fc377e75201"
integrity sha1-FNdoATyvLsj96hakmvgvw3fnUgE=
dependencies:
vlq "^0.2.1"

magic-string@^0.25.2:
version "0.25.2"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9"
integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==
dependencies:
sourcemap-codec "^1.4.4"

make-dir@^1.0.0, make-dir@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
Expand Down Expand Up @@ -8186,6 +8186,13 @@ osenv@0, osenv@^0.1.4, osenv@^0.1.5:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"

ospec@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/ospec/-/ospec-3.1.0.tgz#d36b8e10110f58f63a463df2390a7a73fe9579a8"
integrity sha512-+nGtjV3vlADp+UGfL51miAh/hB4awPBkQrArhcgG4trAaoA2gKt5bf9w0m9ch9zOr555cHWaCHZEDiBOkNZSxw==
dependencies:
glob "^7.1.3"

override-require@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/override-require/-/override-require-1.1.1.tgz#6ae22fadeb1f850ffb0cf4c20ff7b87e5eb650df"
Expand Down Expand Up @@ -9359,6 +9366,14 @@ rollup-plugin-license@^0.8.1:
mkdirp "0.5.1"
moment "2.23.0"

rollup-plugin-modify@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-modify/-/rollup-plugin-modify-3.0.0.tgz#5326e11dfec247e8bbdd9507f3da1da1e5c7818b"
integrity sha512-p/ffs0Y2jz2dEnWjq1oVC7SY37tuS+aP7whoNaQz1EAAOPg+k3vKJo8cMMWx6xpdd0NzhX4y2YF9o/NPu5YR0Q==
dependencies:
magic-string "0.25.2"
ospec "3.1.0"

rollup-plugin-node-resolve@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.3.tgz#638a373a54287d19fcc088fdd1c6fd8a58e4d90a"
Expand Down

0 comments on commit 0c83dbc

Please sign in to comment.