Skip to content

Commit 2f64dd2

Browse files
committed
chore(package): write es modules to esm instead of es6 directory
BREAKING CHANGE: Previously, es modules were published to the es6/ directory inside the npm package. This change publishes them to the esm directory to be consistent with other angular packages. Currently, the es6 directory is still published in the npm package, but will be removed in a future release. Fixes angular#310
1 parent f552d41 commit 2f64dd2

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"version": "2.0.0-beta.2",
44
"description": "",
55
"main": "./dist/angularfire2.js",
6-
"jsnext:main": "./dist/es6/angularfire2.js",
6+
"jsnext:main": "./dist/esm/angularfire2.js",
77
"scripts": {
88
"test": "npm run build; karma start",
99
"docs": "typedoc --out docs/api/ --module commonjs --mode modules --name AngularFire2 src",
1010
"build": "rm -rf dist; tsc",
11-
"build_npm": "rm -rf dist && tsc -p tsconfig.publish.es5.json && tsc -p tsconfig.publish.es6.json",
11+
"build_npm": "rm -rf dist && tsc -p tsconfig.publish.es5.json && tsc -p tsconfig.publish.es6.json && tsc -p tsconfig.publish.es6-deprecated.json",
1212
"postbuild_npm": "cp manual_typings/firebase3/firebase3.d.ts package.json README.md .npmignore dist/ && npm run rewrite_npm_package",
1313
"rewrite_npm_package": "node --harmony_destructuring tools/rewrite-published-package.js",
1414
"build_bundle": "cp -r src angularfire2 && tsc typings/main.d.ts angularfire2.ts --rootDir . --module system -t es5 --outFile dist/bundles/angularfire2.js --moduleResolution node --emitDecoratorMetadata --experimentalDecorators",

tsconfig.publish.es6-deprecated.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"experimentalDecorators": true,
4+
"emitDecoratorMetadata": true,
5+
"target": "es6",
6+
"noImplicitAny": false,
7+
"outDir": "dist/es6",
8+
"rootDir": "src",
9+
"sourceMap": true,
10+
"sourceRoot": "./",
11+
"declaration": true,
12+
"removeComments": true,
13+
"moduleResolution": "node"
14+
},
15+
"files": [
16+
"src/angularfire2.ts",
17+
"manual_typings/firebase3/firebase3.d.ts"
18+
]
19+
}

tsconfig.publish.es6.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"emitDecoratorMetadata": true,
55
"target": "es6",
66
"noImplicitAny": false,
7-
"outDir": "dist/es6",
7+
"outDir": "dist/esm",
88
"rootDir": "src",
99
"sourceMap": true,
1010
"sourceRoot": "./",

0 commit comments

Comments
 (0)