Created
January 10, 2016 23:42
-
-
Save jkuri/d5a3af8cfa1996c8cf6a to your computer and use it in GitHub Desktop.
This file contains hidden or 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' | |
}, | |
meta: { | |
'node_modules/angular2/*': { build: false }, | |
'node_modules/rxjs/*': { build: false } | |
}, | |
}; | |
builder.config(config); | |
builder | |
.bundle(name, path.resolve(__dirname, 'bundles/', name + '.js')) | |
.then(function() { | |
var prodBuilder = new Builder(); | |
prodBuilder.config(config); | |
prodBuilder | |
.bundle(name, path.resolve(__dirname, 'bundles/', name + '.min.js'), { | |
minify: true, sourceMaps: true | |
}) | |
.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
I think this is just a temporary solution as of TypeScript 1.8 this script won't be needed anymore.