Answer the question
In order to leave comments, you need to log in
3rd party local RequireJS library not included?
Hello.
There is a config file for require js with the following code:
requirejs.config({
paths: {
"value": 'modules/index/value',
"dom": 'modules/index/dom',
"app" : "modules/index/app/app",
"init": 'modules/index/init'
},
shim: {
"libs.min": {
exports: 'libs',
}
}
});
require(['value', 'dom', 'app', 'init'],function(value, dom, app, init){
init.initJs();
});
define(['value', 'dom', 'libs'], function(value, dom, libs) {
var app = {
progressBarStart: function() {
NProgress.configure({ ease: 'ease', speed: 900 });
NProgress.start();
},
progressBarDone: function() {
NProgress.done();
}
};
return app;
});
Answer the question
In order to leave comments, you need to log in
You need the opposite: file name (without .js) - exports: module name:
shim: {
"libs.min": {
exports: 'libs',
}
}
Tried like this?
require.config({
paths: {
libs: 'путь/до/libs.min' - обязательно без .js
},
shim: {
libs: {
exports: 'libs',
deps: ['jquery']
}
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question