From a7554a88262f7328c82bae87a5f60a30066f4610 Mon Sep 17 00:00:00 2001 From: Valentin Richard Date: Fri, 7 Oct 2016 14:25:41 +0200 Subject: [PATCH] feat(UMD): added UMD bundles closes #1098 --- .npmignore | 2 ++ make.js | 37 +++++++++++++++++++++++++++++++++++++ tsconfig.json | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 make.js diff --git a/.npmignore b/.npmignore index 3bbe927bb7..249023e771 100644 --- a/.npmignore +++ b/.npmignore @@ -37,6 +37,8 @@ webpack.config.js *.js.map !/bundles/*.js.map !*.d.ts +!*.metadata.json +make.js /components/**/*.ts !/components/**/*.d.ts diff --git a/make.js b/make.js new file mode 100644 index 0000000000..8be6dfe9e0 --- /dev/null +++ b/make.js @@ -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); + }); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 46fb635f23..bbc619300e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,4 +26,4 @@ "./ng2-bootstrap.ts" ], "atom": { "rewriteTsconfig": false } -} +} \ No newline at end of file