rewrite require.js:support for combo server Loader combo server
- combo + require
- support for localstorage cache
- resrouces of css,js,html(precompile)[TODO:only for artTemplate now])
gulp default
http://127.0.0.1:8991/
relative path,base on process.cwd
md5 json file path,base on cwd
relative path of resource by file type,base on cwd
var comboServer = require('../service/combo')
app.get('/combo/', new comboServer({
cwd: 'test/public',
versionDir: 'data',
pathMap: {
css: 'css',
js: 'js',
html: 'tpl',
},
}));
<script src="require.js"></script>
<script src="config.js"></script>
<script src="loader.js"></script>
only support amd and return
new export.Loader(['file1', 'file2']);
####COMBO server combo url format:
file_1@version_1;file_2@version_2
the wating time of loader
localStorage prefix
combo host name
export the Loader instance to
require.config({
combo: {
timeout: 60000,
locPrefix: 'm_lsc_',
webBase: 'combo'
},
exportLoader: window
});
require(['test-1', 'test-2', 'base.css'], function () {
//callback
});
##TODO
- 配置入口优化
- 支持请求预编译的模板js文件