Skip to content

Commit

Permalink
Resolve problems with umd bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ghetolay committed Nov 5, 2016
1 parent c69ba33 commit a80af36
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ src/**/*.js
npm-debug.log/

node_modules/
bundle/
dist/

#IDE
*.sublime-workspace
Expand Down
12 changes: 11 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
npm-debug.log/

node_modules/

#IDE
*.sublime-workspace
*.sublime-project
.editorconfig
*.json
.vscode

tsconfig.json
tslint.json
gulpfile.js
scripts/
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down
16 changes: 14 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit a80af36

Please sign in to comment.