本文整理汇总了TypeScript中systemjs-builder.bundle函数的典型用法代码示例。如果您正苦于以下问题:TypeScript bundle函数的具体用法?TypeScript bundle怎么用?TypeScript bundle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bundle函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
return builder.trace('igniteui-js-blocks/main').then(trees => {
console.log('tree resolved');
return Promise.all([
builder.bundle(trees, './dist/bundles/igniteui-js-blocks.dev.js'),
builder.bundle(trees, './dist/bundles/igniteui-js-blocks.min.js', { minify: true })
]);
});
示例2:
return builder.trace('zero-blocks/main').then(function(trees) {
console.log("tree resolved");
return Promise.all([
builder.bundle(trees, './dist/bundles/zero-blocks.dev.js'),
builder.bundle(trees, './dist/bundles/zero-blocks.min.js', { minify: true })
]);
});
示例3:
.then(() => {
return builder.bundle('app/ui - [app/**/*]', 'dist/vendor_ui.js', {minify: util.env.production})
.then(() => {
return builder.bundle('app/worker - [app/**/*]', 'dist/vendor_worker.js',
{minify: util.env.production});
});
})
示例4: bundleApp
function bundleApp(done) {
builder.bundle(
'bootstrap - angular2/*',
join(BUNDLES_DEST, 'app.js'),
BUNDLE_OPTS
).then(done);
}
示例5: Builder
export = (done: any) => {
const options = {
normalize: true,
runtime: false,
sourceMaps: true,
sourceMapContents: true,
minify: true,
mangle: false
};
const builder = new Builder('./');
builder.config({
paths: {
'n:*': 'node_modules/*',
'rxjs/*': 'node_modules/rxjs/*.js',
},
map: {
'rxjs': 'n:rxjs',
},
packages: {
'rxjs': {main: 'Rx.js', defaultExtension: 'js'},
}
});
builder.bundle('rxjs', 'node_modules/.tmp/Rx.min.js', options)
.then(() => done())
.catch((error: any) => done(error));
};
示例6: Builder
module.exports = () => {
const options = {
'normalize': true,
'runtime': false,
'sourceMaps': true,
'sourceMapContents': false,
'minify': true,
'mangle': false
};
const builder = new Builder('./');
builder.config({
'paths': {
'n:*': 'node_modules/*',
'rxjs/*': 'node_modules/rxjs/*.js',
'rxjs/internal-compatibility': 'node_modules/rxjs/internal-compatibility/index.js',
'rxjs/testing': 'node_modules/rxjs/testing/index.js',
'rxjs/ajax': 'node_modules/rxjs/ajax/index.js',
'rxjs/operators': 'node_modules/rxjs/operators/index.js',
'rxjs/webSocket': 'node_modules/rxjs/webSocket/index.js',
},
'map': {
'rxjs': 'n:rxjs'
},
'packages': {
'rxjs': { 'main': 'index.js', 'defaultExtension': 'js' }
}
});
return builder.bundle('rxjs/index.js + ' +
'rxjs/operators/index.js + ' +
'rxjs/internal-compatibility/index.js + ' +
'rxjs/testing/index.js + ' +
'rxjs/ajax/index.js + ' +
'rxjs/webSocket/index.js',
'node_modules/.tmp/Rx.min.js', options)
.then((output: any) => {
const writeFile = promisify(fs.writeFile);
const code = output.source.replace(/rxjs\/index/gm, 'rxjs');
return writeFile('node_modules/.tmp/Rx.min.js',
(options.sourceMaps)
? code + `\n//# sourceMappingURL=Rx.min.js.map`
: code);
});
};
示例7:
.then(() => {
return builder.bundle('app - [app/**/*]', 'dist/vendor.js', {minify: util.env.production})
})
示例8: function
return function () {
return builder.bundle('ng2-bootstrap/ng2-bootstrap - angular2/*',
join(PATH.dest.dev.lib, 'ng2-bootstrap.js'));
};