Skip to content

Commit

Permalink
bundle array/includes, object/assign from core-js into `dist/*/bundle…
Browse files Browse the repository at this point in the history
…s/index.umd.js`

(not bundle into `index.esm.js` & other module types)
  • Loading branch information
giabao committed Apr 19, 2019
1 parent 0181b41 commit 0a98742
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ A cross-browser JavaScript range and selection library.
- `RangePrototype, rangePrototype, selectionPrototype`
- `WrappedTextRange`

+ if you want support IE, please shim, ex with [core-js](https://www.npmjs.com/package/core-js):
+ note: to support IE, we bundled the following [core-js](https://www.npmjs.com/package/core-js) modules
into `dist/*/bundles/index.umd.js` (not bundle into `index.esm.js` & other module types)
```javascript
import "core-js/features/array/includes";
import "core-js/features/object/assign";

```

## Install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"es2015": "./esm2015/index.js",
"typings": "./types/index.d.ts",
"dependencies": {
"core-js": "^3.0.1",
"tslib": "^1.9.3"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/qunit": "^2.5.4",
"core-js": "^3.0.1",
"glob": "^7.1.3",
"log4javascript": "^1.4.15",
"npm-run-all": "^4.1.5",
Expand Down
4 changes: 2 additions & 2 deletions scripts/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function configsFor(name: string): RollupOptions[] {
sourcemap: true,
},
inlineDynamicImports: true,
// only bundle tslib in umd file
external: [...external, 'tslib'],
// only bundle tslib, core-js in umd file
external: (id) => [...external, 'tslib', 'core-js'].includes(id) || id.startsWith('core-js/'),
plugins,
}
]
Expand Down
3 changes: 3 additions & 0 deletions src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* Version: %%build:version%%
* Build date: %%build:date%%
*/
import "core-js/features/array/includes";
import "core-js/features/object/assign";

export * from "./api";

import * as util from "./util";
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/node@*", "@types/node@^11.13.4":
version "11.13.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.4.tgz#f83ec3c3e05b174b7241fadeb6688267fe5b22ca"
integrity sha512-+rabAZZ3Yn7tF/XPGHupKIL5EcAbrLxnTr/hgQICxbeuAfWtT0UZSfULE+ndusckBItcv4o6ZeOJplQikVcLvQ==
"@types/node@*", "@types/node@^11.13.5":
version "11.13.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.5.tgz#266564afa8a6a09dc778dfacc703ed3f09c80516"
integrity sha512-/OMMBnjVtDuwX1tg2pkYVSqRIDSmNTnvVvmvP/2xiMAAWf4a5+JozrApCrO4WCAILmXVxfNoQ3E+0HJbNpFVGg==

"@types/qunit@^2.5.4":
version "2.5.4"
Expand Down Expand Up @@ -1041,12 +1041,12 @@ rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.6.0:
micromatch "^3.1.10"

rollup@^1.8.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.10.0.tgz#91d594aa4386c51ca0883ad4ef2050b469d3e8aa"
integrity sha512-U9t/JaKtO0+X0pSmLVKMrAZEixrbVzITf193TiEhfoVKCnd7pDimIFo94IxUCgbn6+v5VmduHkubx2VV1s0Ftw==
version "1.10.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.10.1.tgz#aeb763bbe98f707dc6496708db88372fa66687e7"
integrity sha512-pW353tmBE7QP622ITkGxtqF0d5gSRCVPD9xqM+fcPjudeZfoXMFW2sCzsTe2TU/zU1xamIjiS9xuFCPVT9fESw==
dependencies:
"@types/estree" "0.0.39"
"@types/node" "^11.13.4"
"@types/node" "^11.13.5"
acorn "^6.1.1"

safe-regex@^1.1.0:
Expand Down Expand Up @@ -1252,9 +1252,9 @@ tslib@1.9.3, tslib@^1.9.3:
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==

typescript@^3.4.1:
version "3.4.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.3.tgz#0eb320e4ace9b10eadf5bc6103286b0f8b7c224f"
integrity sha512-FFgHdPt4T/duxx6Ndf7hwgMZZjZpB+U0nMNGVCYPq0rEzWKjEDobm4J6yb3CS7naZ0yURFqdw9Gwc7UOh/P9oQ==
version "3.4.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.4.tgz#aac4a08abecab8091a75f10842ffa0631818f785"
integrity sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==

union-value@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 0a98742

Please sign in to comment.