main.js
697 Bytes
requirejs.config({
baseUrl:'js',
paths: {
jquery: 'jquery-2.1.3.min',
underscore:'underscore-min',
text:'text',
fastclick: 'fastclick',
common: 'common',
},
shim:{
underscore:{
exports:'_'
}
}
});
requirejs(['fastclick','topic'], function(attachFastClick, Topic){
var FastClick = require('fastclick');
FastClick.attach(document.body);
Topic.initialize();
});
requirejs.onError = function (err) {
console.log(err.requireType);
if (err.requireType === 'timeout') {
alert('加载超时,请重试!');
console.log('modules: ' + err.requireModules);
}
throw err;
};