Skip to content

Commit

Permalink
feat(bundles): Point package.json main: to the umd bundle. Stop shipp…
Browse files Browse the repository at this point in the history
…ing 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.
  • Loading branch information
christopherthielen committed Jan 21, 2017
1 parent 9aae71a commit 34ea6ad
Show file tree
Hide file tree
Showing 4 changed files with 740 additions and 338 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "1.0.0-beta.4",
"scripts": {
"clean": "shx rm -rf lib lib-esm _bundles _doc",
"build": "npm run clean && ngc && ngc -p tsconfig.esm.json && webpack",
"compile": "npm run clean && ngc",
"build": "npm run compile && webpack",
"test": "karma start config/karma.ng2.js",
"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",
"prepublish": "npm run build"
Expand Down Expand Up @@ -46,8 +47,8 @@
"node": ">4"
},
"license": "MIT",
"jsnext:main": "lib-esm/index.js",
"main": "lib/index.js",
"main": "_bundles/ui-router-ng2.js",
"module": "lib/index.js",
"typings": "lib/index.d.ts",
"dependencies": {
"ui-router-core": "=3.1.1",
Expand Down
22 changes: 0 additions & 22 deletions tsconfig.esm.json

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"module": "commonjs",
"module": "es6",
"target": "es5",
"lib": [ "es6", "dom" ],
"allowSyntheticDefaultImports": true,
Expand Down
Loading

0 comments on commit 34ea6ad

Please sign in to comment.