From a80af366c59bc0b8b51e5facacc39f0fe67820c7 Mon Sep 17 00:00:00 2001 From: ghetolay Date: Sat, 5 Nov 2016 21:25:31 +0100 Subject: [PATCH] Resolve problems with umd bundle --- .gitignore | 2 ++ .npmignore | 12 +++++++++++- .vscode/settings.json | 3 --- README.md | 3 ++- gulpfile.js | 16 ++++++++++++++-- package.json | 2 +- 6 files changed, 30 insertions(+), 8 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 90de440b5..7f57a2419 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ src/**/*.js npm-debug.log/ node_modules/ +bundle/ +dist/ #IDE *.sublime-workspace diff --git a/.npmignore b/.npmignore index 935adaa6a..b85fd955a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,14 @@ +npm-debug.log/ + +node_modules/ + +#IDE +*.sublime-workspace +*.sublime-project .editorconfig -*.json +.vscode + +tsconfig.json +tslint.json gulpfile.js scripts/ diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 25fa6215f..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "typescript.tsdk": "node_modules/typescript/lib" -} diff --git a/README.md b/README.md index 5b9256449..35f276c88 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ Angular2 Datepicker Component ***ng2-datepicker*** is a datepicker component for Angular2. ## Demo -No demo available yet + +https://plnkr.co/edit/MgvFblLHi4N3tyLVCWYD?p=preview ## Installation: Datepicker relies on [momentjs](http://momentjs.com/) so you must first install it : diff --git a/gulpfile.js b/gulpfile.js index 0c6865c10..0a4d3840f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -91,13 +91,13 @@ gulp.task('build:rollup', () => { }; return rollup({ - entry: 'src/ng2-datepicker.ts', + entry: 'dist/ng2-datepicker.js', context: 'this', globals: globals, external: Object.keys(globals), sourceMap: true, format: 'umd', - moduleName:'ng2-datepicker', + moduleName:'ng2.datepicker', plugins: [ /* Problem with rollup on moment imports https://github.com/rollup/rollup-plugin-typescript/issues/68 @@ -111,6 +111,18 @@ gulp.task('build:rollup', () => { map: { mappings: '' } }) }, + /* + export of interface cause errors to rollup + https://github.com/rollup/rollup-plugin-typescript/issues/65 + */ + { + name: 'replace interface export', + transform: code => + ({ + code: code.replace(/export\s*{\s*RangeSelectDirective,\s*RangeDate\s*}/g, 'export { RangeSelectDirective }'), + map: { mappings: '' } + }) + }, rollupTs({ typescript: require('typescript') }) diff --git a/package.json b/package.json index dd377256b..f70205eb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng2-datepicker", - "version": "1.1.1", + "version": "2.0.0-dev5", "description": "Angular2 Datepicker", "main": "bundle/ng2-datepicker.umd.js", "typings": "dist/ng2-datepicker.d.ts",