From e1e1285fad9a6dde11025201a938ea67775b0d4f Mon Sep 17 00:00:00 2001 From: Jan Kuri Date: Thu, 16 Feb 2017 20:38:41 +0100 Subject: [PATCH] build(umd): umd bundles --- .npmignore | 3 ++- index.ts | 15 --------------- ngx-uploader.ts | 16 +++++++++++++++- package.json | 13 +++++++++---- scripts/clean.sh | 2 +- tsconfig.json | 2 +- 6 files changed, 28 insertions(+), 23 deletions(-) delete mode 100644 index.ts diff --git a/.npmignore b/.npmignore index b42d0428..01f6b23b 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ /node_modules -/typings \ No newline at end of file +/typings +/aot diff --git a/index.ts b/index.ts deleted file mode 100644 index d3220c59..00000000 --- a/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NgFileDropDirective } from './src/directives/ng-file-drop'; -import { NgFileSelectDirective } from './src/directives/ng-file-select'; - -export * from './src/directives/ng-file-drop'; -export * from './src/directives/ng-file-select'; -export * from './src/services/ngx-uploader'; - -export { NgUploaderOptions, UploadedFile, UploadRejected } from './src/classes/index'; - -export { NgUploaderModule } from './src/module/ngx-uploader.module'; - -export const UPLOAD_DIRECTIVES: any[] = [ - NgFileSelectDirective, - NgFileDropDirective -]; diff --git a/ngx-uploader.ts b/ngx-uploader.ts index ea465c2a..d3220c59 100644 --- a/ngx-uploader.ts +++ b/ngx-uploader.ts @@ -1 +1,15 @@ -export * from './index'; +import { NgFileDropDirective } from './src/directives/ng-file-drop'; +import { NgFileSelectDirective } from './src/directives/ng-file-select'; + +export * from './src/directives/ng-file-drop'; +export * from './src/directives/ng-file-select'; +export * from './src/services/ngx-uploader'; + +export { NgUploaderOptions, UploadedFile, UploadRejected } from './src/classes/index'; + +export { NgUploaderModule } from './src/module/ngx-uploader.module'; + +export const UPLOAD_DIRECTIVES: any[] = [ + NgFileSelectDirective, + NgFileDropDirective +]; diff --git a/package.json b/package.json index c9b61b2d..7dc4bfc5 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,16 @@ { "name": "ngx-uploader", "description": "Angular File Uploader", - "version": "2.1.6", + "version": "2.1.11", "license": "MIT", - "main": "index.js", - "typings": "index.d.ts", + "main": "bundle/ngx-uploader.umd.js", + "module": "ngx-uploader.js", + "typings": "ngx-uploader.d.ts", "author": "Jan Kuri ", "scripts": { "clean": "./scripts/clean.sh", "dev": "tsc --watch", - "build": "./node_modules/.bin/ngc -p tsconfig.json", + "build": "./node_modules/.bin/ngc -p tsconfig.json && rollup -c", "prepublish": "npm run build", "lint": "tslint \"src/**/*.ts\"", "docs": "gulp docs", @@ -41,6 +42,10 @@ "gulp-conventional-changelog": "^1.1.0", "gulp-typedoc": "^2.0.2", "reflect-metadata": "^0.1.9", + "rollup": "^0.41.4", + "rollup-plugin-buble": "^0.15.0", + "rollup-plugin-commonjs": "^7.0.0", + "rollup-plugin-node-resolve": "^2.0.0", "rxjs": "^5.1.0", "tslint": "^4.4.2", "typedoc": "^0.5.5", diff --git a/scripts/clean.sh b/scripts/clean.sh index 476e0c16..e1a9e132 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,6 +1,6 @@ #!/bin/bash -find . -name "*.js" -type f -and -not -path "./node_modules/*" -and -not -path "./gulpfile.js" -delete +find . -name "*.js" -type f -and -not -path "./node_modules/*" -and -not -path "./gulpfile.js" -and -not -path "./make.js" -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 diff --git a/tsconfig.json b/tsconfig.json index bbbc9394..47a808ac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "es5", + "module": "es2015", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, @@ -28,7 +29,6 @@ "dist" ], "files": [ - "index.ts", "ngx-uploader.ts" ], "angularCompilerOptions": {