我正在尝试自动捆绑所有jspm依赖项 - 所以我不需要维护手动列表 - 使用gulp任务:
var x = "Hello World WhatABeautifulDay Good_bye CruelWorld BOB TaDa";
var y = x.split(/\s+|_|(?=[A-Z][a-z])/);
var z = y.map(function (obj) {
return obj.replace(/([a-z])(?=[A-Z]$)/, '\$1-');
}).join('-');
console.log(z);
// Hello-World-What-A-Beautiful-Day-Good-bye-Cruel-World-BOB-Ta-Da
不幸的是,这并没有拾取和捆绑捆绑包中包含的模块的所有子依赖项。很多依赖项是由aurelia动态加载的,在捆绑过程中不会被检测到。
有没有办法强制aurelia-bundler(或jspm-cli)从jspm捆绑整个依赖树?
[更新] 关闭jspm的捆绑器has the same behavior,因为它不会捆绑模块,除非它检测到对var gulp = require('gulp');
var bundler = require('aurelia-bundler');
var package = require('../../package.json');
var jspmDeps = Object.keys(package.jspm.dependencies);
var config = {
force: true,
baseURL: '.',
configPath: './system.config.js',
bundles: {
"output/jspm": {
"includes": jspmDeps,
"options": {
"minify": false,
"inject" : true
}
}
}
};
gulp.task('build-jspm', function () {
return bundler.bundle(config);
});
的调用; there are plans to trace dynamic loading at some point