diff --git a/package.json b/package.json index eca4a6a..9757b1e 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "1.2.4", "description": "An angular 4.0+ directive that allows an element to be dragged and resized", "main": "./dist/umd/angular-resizable-element.js", - "module": "./dist/esm/src/index.js", - "typings": "./dist/esm/src/index.d.ts", + "module": "./dist/esm/angular-resizable-element.js", + "typings": "./dist/esm/src/angular-resizable-element.d.ts", "scripts": { "start": "concurrently --raw \"webpack-dev-server --open\" \"npm run test:watch\"", "build:demo": "webpack -p", "build:umd": "webpack --config webpack.config.umd.ts", - "build:ngc": "ngc -p tsconfig-ngc.json", + "build:ngc": "ngc -p tsconfig-ngc.json && rollup -c", "build:dist": "npm run build:umd && npm run build:ngc", "build:clean": "rm -rf dist", "test": "karma start --single-run && npm run build:dist && npm run build:clean", @@ -68,6 +68,7 @@ "karma-jasmine": "^1.0.2", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^2.0.3", + "rollup": "^0.52.0", "rxjs": "^5.0.0", "sinon": "^2.1.0", "sinon-chai": "^2.9.0", diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..76ba009 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,26 @@ +const globals = { + '@angular/core': 'ng.core', + 'rxjs/Subject': 'Rx', + 'rxjs/Observable': 'Rx', + 'rxjs/observable/merge': 'Rx.Observable', + 'rxjs/observable/interval': 'Rx.Observable', + 'rxjs/add/operator/map': 'Rx.Observable.prototype', + 'rxjs/add/operator/mergeMap': 'Rx.Observable.prototype', + 'rxjs/add/operator/takeUntil': 'Rx.Observable.prototype', + 'rxjs/add/operator/filter': 'Rx.Observable.prototype', + 'rxjs/add/operator/pairwise': 'Rx.Observable.prototype', + 'rxjs/add/operator/take': 'Rx.Observable.prototype', + 'rxjs/add/operator/throttle': 'Rx.Observable.prototype', + 'rxjs/add/operator/share': 'Rx.Observable.prototype', +}; + +export default { + input: 'dist/esm/src/angular-resizable-element.js', + external: Object.keys(globals), + output: { + file: 'dist/esm/angular-resizable-element.js', + format: 'es', + globals: globals, + sourcemap: true, + } +} diff --git a/tsconfig-ngc.json b/tsconfig-ngc.json index 529358f..66e83cd 100644 --- a/tsconfig-ngc.json +++ b/tsconfig-ngc.json @@ -21,6 +21,9 @@ "strictMetadataEmit": true, "genDir": "./dist/esm", "skipTemplateCodegen": true, - "debug": true + "debug": true, + "flatModuleOutFile": "angular-resizable-element.js", + "flatModuleId": "angular-resizable-element", + "annotateForClosureCompiler": true } -} \ No newline at end of file +}