-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): added systemjs bundles
- Loading branch information
Showing
4 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env node | ||
/*eslint no-console: 0*/ | ||
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: path.resolve('node_modules/typescript/lib/typescript.js'), | ||
angular2: path.resolve('node_modules/angular2'), | ||
rxjs: path.resolve('node_modules/rxjs') | ||
}, | ||
paths: { | ||
'*': '*.js' | ||
}, | ||
meta: {} | ||
}; | ||
|
||
config.meta[path.join(name, 'node_modules/angular2/*')] = {build: false}; | ||
config.meta[path.join(name, 'node_modules/rxjs/*')] = {build: false}; | ||
|
||
builder.config(config); | ||
|
||
builder | ||
.bundle([name, name].join('/'), path.resolve(__dirname, 'bundles/', name + '.js')) | ||
.then(function () { | ||
var prodBuilder = new Builder(); | ||
prodBuilder.config(config); | ||
|
||
prodBuilder | ||
.bundle([name, name].join('/'), path.resolve(__dirname, 'bundles/', name + '.min.js'), { | ||
minify: true, sourceMaps: true | ||
}) | ||
.then(function () { | ||
console.log('Build complete.'); | ||
}); | ||
}) | ||
.catch(function (err) { | ||
console.log('Error', err); | ||
}); |
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