Skip to content

Commit 34ea6ad

Browse files
feat(bundles): Point package.json main: to the umd bundle. Stop shipping commonjs.
BREAKING CHANGE: We no longer ship commonjs in the npm package. We now ship esm+es5 (individual files) and UMD bundles only. This brings ui-router-ng2 npm package in line with how the core Angular 2 packages are packaged. We compile and distribute esm+es5 + typescript typings in `lib/` (formerly in `lib-esm/`) We *no longer include the commonjs+es5* (formerly in `lib/`) We now point the `main:` entry to the UMD bundle for commonjs users.
1 parent 9aae71a commit 34ea6ad

File tree

4 files changed

+740
-338
lines changed

4 files changed

+740
-338
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"version": "1.0.0-beta.4",
55
"scripts": {
66
"clean": "shx rm -rf lib lib-esm _bundles _doc",
7-
"build": "npm run clean && ngc && ngc -p tsconfig.esm.json && webpack",
7+
"compile": "npm run clean && ngc",
8+
"build": "npm run compile && webpack",
89
"test": "karma start config/karma.ng2.js",
910
"docs": "typedoc --tsconfig tsconfig.typedoc.json --readme README.md --name 'ui-router-ng2' --theme node_modules/ui-router-typedoc-themes/bin/default --out _doc --internal-aliases internal,coreapi,ng2api --external-aliases internalapi,external --navigation-label-globals ui-router-ng2",
1011
"prepublish": "npm run build"
@@ -46,8 +47,8 @@
4647
"node": ">4"
4748
},
4849
"license": "MIT",
49-
"jsnext:main": "lib-esm/index.js",
50-
"main": "lib/index.js",
50+
"main": "_bundles/ui-router-ng2.js",
51+
"module": "lib/index.js",
5152
"typings": "lib/index.d.ts",
5253
"dependencies": {
5354
"ui-router-core": "=3.1.1",

tsconfig.esm.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"emitDecoratorMetadata": true,
44
"experimentalDecorators": true,
55
"moduleResolution": "node",
6-
"module": "commonjs",
6+
"module": "es6",
77
"target": "es5",
88
"lib": [ "es6", "dom" ],
99
"allowSyntheticDefaultImports": true,

0 commit comments

Comments
 (0)