Skip to content

Commit

Permalink
Make ng2-uploader compatible with AoT compiler (bleenco#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelsoSantos authored and jkuri committed Dec 6, 2016
1 parent 0d4433a commit 767a49f
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
**/*.js.map
**/*.d.ts

/aot
*.metadata.json
**/*.ngFactory.ts

/npm-debug.log

/node_modules
Expand Down
23 changes: 4 additions & 19 deletions ng2-uploader.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import { NgModule } from '@angular/core';
import { NgFileDropDirective } from './src/directives/ng-file-drop';
import { NgFileSelectDirective } from './src/directives/ng-file-select';
import { Ng2Uploader } from './src/services/ng2-uploader';

@NgModule({
declarations: [
NgFileDropDirective,
NgFileSelectDirective
],
providers: [
Ng2Uploader
],
exports: [
NgFileDropDirective,
NgFileSelectDirective
]
})
export class Ng2UploaderModule{}
export * from './src/directives/ng-file-drop';
export * from './src/directives/ng-file-select';
export * from './src/services/ng2-uploader';

export { Ng2UploaderModule } from './src/module/ng2-uploader.module';
25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "ng2-uploader",
"description": "Angular2 File Uploader",
"version": "1.5.5",
"version": "1.5.6",
"license": "MIT",
"main": "ng2-uploader.js",
"typings": "ng2-uploader.d.ts",
"author": "Jan Kuri <[email protected]>",
"scripts": {
"clean": "./scripts/clean.sh",
"dev": "tsc --watch",
"prepublish": "tsc"
"dev": "ngc --watch",
"postinstall": "./node_modules/.bin/ngc -p tsconfig.json"
},
"repository": {
"type": "git",
Expand All @@ -24,13 +24,20 @@
"uploader"
],
"devDependencies": {
"@angular/common": "^2.0.2",
"@angular/compiler": "^2.0.2",
"@angular/core": "^2.0.2",
"core-js": "^2.4.1",
"@angular/common": "^2.2.3",
"@angular/compiler": "^2.2.3",
"@angular/compiler-cli": "^2.2.3",
"@angular/core": "^2.2.3",
"@angular/platform-server": "^2.2.3",
"@angular/platform-browser": "^2.2.3",
"@angular/platform-browser-dynamic": "^2.2.3",
"@types/node": "6.0.51",
"reflect-metadata": "^0.1.8",
"rxjs": "^5.0.0-beta.12",
"typescript": "^2.0.3",
"rxjs": "5.0.0-rc.4",
"typescript": "^2.0.10",
"zone.js": "^0.6.25"
},
"dependencies": {
"@types/core-js": "^0.9.34"
}
}
1 change: 1 addition & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
find . -name "*.js" -type f -not -path "./node_modules/*" -delete
find . -name "*.js.map" -type f -not -path "./node_modules/*" -delete
find . -name "*.d.ts" -type f -not -path "./node_modules/*" -delete
find . -name "*.metadata.json" -type f -not -path "./node_modules/*" -delete
20 changes: 20 additions & 0 deletions src/module/ng2-uploader.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { NgFileDropDirective } from './../directives/ng-file-drop';
import { NgFileSelectDirective } from './../directives/ng-file-select';
import { Ng2Uploader } from './../services/ng2-uploader';

@NgModule({
declarations: [
NgFileDropDirective,
NgFileSelectDirective
],
providers: [
Ng2Uploader
],
exports: [
NgFileDropDirective,
NgFileSelectDirective
]
})
export class Ng2UploaderModule{}

34 changes: 28 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
{
"compilerOptions": {
"declaration": true,
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": false,
"noEmitHelpers": false,
"noImplicitAny": true,
"declaration": true,
"skipLibCheck": true,
"stripInternal": true,
"lib": ["es6", "dom"],
"rootDir": ".",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5"
"types": [
"node"
]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"bundles",
"dist"
],
"files": [
"ng2-uploader.ts"
],
"angularCompilerOptions": {
"genDir": "aot",
"skipMetadataEmit" : false
}
}
}

0 comments on commit 767a49f

Please sign in to comment.