-
Notifications
You must be signed in to change notification settings - Fork 7
Home
增量更新原理请看:js增量更新方案
###在需要这个插件的页面里面引入plugin-storeinc.js
<script src="../sea-modules/seajs/seajs/2.1.1/sea-debug.js"></script>
//引入plugin-storeinc.js
<script src="../sea-modules/seajs/seajs/2.1.1/plugin-storeinc.js"></script>
<script>
// Set configuration
var version='1.0.6'
seajs.config({
base: "../sea-modules/",
alias: {
"jquery": "jquery/jquery/1.10.1/jquery.js"
}
});
seajs.use('plugin-storeinc', function(store) {
store.configStroreInc({'store':true,'inc':true,'jsver':version,'aliasver':'1.10.2','debug':false});
// For development
if (location.href.indexOf("?dev") > 0) {
seajs.use("../static/hello/src/main");
}
// For production
else {
seajs.use("examples/hello/"+version+"/main");
}
});
npm install spm-storeinc-build -g
{
"family": "examples",
"name": "hello",
"lastversion":"1.0.5",
"version": "1.0.6",
//增量更新计算中的块大小,增量更新原理请看:js增量更新方案
"chunkSize":12,
"spm": {
`"alias": {`
` "jquery": "jquery"`
},
`"output": ["main.js", "style.css"]`
}
}