Created
February 7, 2016 08:19
-
-
Save jkuri/9310c642e243156938a2 to your computer and use it in GitHub Desktop.
SystemJS build script for Angular2 with vendor included
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | |
angular2: path.resolve('node_modules/angular2'), | |
rxjs: path.resolve('node_modules/rxjs') | |
}, | |
paths: { | |
'*': '*.js', | |
'moment': 'node_modules/moment/moment.js' | |
}, | |
meta: { | |
'node_modules/angular2/*': { build: false }, | |
'node_modules/rxjs/*': { build: false }, | |
'moment': { 'format': 'global' } | |
}, | |
}; | |
builder.config(config); | |
builder | |
.bundle(name, path.resolve(__dirname, 'bundles/', name + '.js')) | |
.then(function() { | |
console.log('Build complete.'); | |
}) | |
.catch(function(err) { | |
console.log('Error', err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment