Skip to content

Commit

Permalink
feat(UMD): added UMD bundles
Browse files Browse the repository at this point in the history
closes #1098
  • Loading branch information
Valentin Richard authored and valorkin committed Oct 11, 2016
1 parent 17cfc09 commit a7554a8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ webpack.config.js
*.js.map
!/bundles/*.js.map
!*.d.ts
!*.metadata.json
make.js
/components/**/*.ts
!/components/**/*.d.ts

Expand Down
37 changes: 37 additions & 0 deletions make.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;

var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {
module: 'cjs'
},
map: {
'typescript': './node_modules/typescript/lib/typescript.js',
'@angular': './node_modules/@angular',
'rxjs': './node_modules/rxjs',
'moment': './node_modules/moment/moment.js'
},
paths: {
'*': '*.js'
},
meta: {
'./node_modules/@angular/*': { build: false },
'./node_modules/rxjs/*': { build: false }
}
};

builder.config(config);

builder
.buildStatic(name, path.resolve(__dirname, 'bundles/', name + '.js'), {format: 'umd'})
.then(function() {
console.log('Build complete.');
})
.catch(function(err) {
console.log('Error', err);
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
"./ng2-bootstrap.ts"
],
"atom": { "rewriteTsconfig": false }
}
}

0 comments on commit a7554a8

Please sign in to comment.