From f100a334ececee7c1a911960de38f40909de9298 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Sat, 1 Oct 2016 22:34:19 +0100 Subject: [PATCH] feat(*): AoT compilation support (with ngc) fix #68 --- .gitignore | 4 ++++ package.json | 21 +++++++++++++++++---- tsconfig.json | 10 ++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c3098a4..b3a22fb 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,7 @@ module.d.ts *.spec.js *.spec.js.map *.spec.d.ts + +# ngc generated files +/compiled +*.metadata.json diff --git a/package.json b/package.json index a03406e..5b6205a 100644 --- a/package.json +++ b/package.json @@ -8,41 +8,48 @@ "index.js", "index.js.map", "index.d.ts", + "index.metadata.json", "src/index.ts", "module.js", "module.js.map", "module.d.ts", + "module.metadata.json", "src/module.ts", - "typings.json", "CalendarPipe.js", "CalendarPipe.js.map", "CalendarPipe.d.ts", + "CalendarPipe.metadata.json", "src/CalendarPipe.ts", "DateFormatPipe.js", "DateFormatPipe.js.map", "DateFormatPipe.d.ts", + "DateFormatPipe.metadata.json", "src/DateFormatPipe.ts", "DifferencePipe.js", "DifferencePipe.js.map", "DifferencePipe.d.ts", + "DifferencePipe.metadata.json", "src/DifferencePipe.ts", "DurationPipe.js", "DurationPipe.js.map", "DurationPipe.d.ts", + "DurationPipe.metadata.json", "src/DurationPipe.ts", "TimeAgoPipe.js", "TimeAgoPipe.js.map", "TimeAgoPipe.d.ts", + "TimeAgoPipe.metadata.json", "src/TimeAgoPipe.ts", "FromUnixPipe.js", "FromUnixPipe.js.map", "FromUnixPipe.d.ts", + "FromUnixPipe.metadata.json", "src/FromUnixPipe.ts", "CHANGELOG.md" ], "scripts": { - "test": "tslint src/*.ts --exclude=src/*.d.ts && tsc && karma start", - "prepublish": "tsc --outDir ." + "test": "tslint src/*.ts --exclude=src/*.d.ts && ngc && karma start", + "prepublish": "ngc && copyfiles -f src/*.js src/*.js.map src/*.d.ts src/*.metadata.json ." }, "repository": { "type": "git", @@ -65,10 +72,16 @@ "moment": "^2.11.2" }, "devDependencies": { - "@angular/core": "2.0.0", + "@angular/common": "2.0.1", + "@angular/compiler": "2.0.1", + "@angular/compiler-cli": "0.6.3", + "@angular/core": "2.0.1", + "@angular/platform-browser": "2.0.1", + "@angular/platform-server": "2.0.1", "@types/jasmine": "2.2.34", "@types/moment": "2.13.0", "awesome-typescript-loader": "2.2.4", + "copyfiles": "1.0.0", "es6-shim": "0.35.1", "jasmine-core": "2.4.1", "karma": "1.1.0", diff --git a/tsconfig.json b/tsconfig.json index e0db1c8..5b79335 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,10 @@ "noImplicitAny": true, "module": "commonjs", "target": "es5", - "lib": ["es2015", "dom"], + "lib": [ + "es2015", + "dom" + ], "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, @@ -25,5 +28,8 @@ "src/TimeAgoPipe.spec.ts", "src/module.ts", "src/index.ts" - ] + ], + "angularCompilerOptions": { + "genDir": "compiled" + } }