Что за оптимальная загрузка?
Так работает?
<script src="assets/js/modules/config_modules.js"></script>
<script data-main="assets/js/page_js/basket.js" src="assets/js/require.js"></script>
и в config_modules.js
var require = {
baseUrl: "assets/js/modules",
paths: {
constants: "constants",
firebase: "firebase/firebase-app",
firebase_auth: "firebase/firebase-auth",
firebase_database: "firebase/firebase-database",
databaseModule: "databaseModule",
user_entity: "entities/user",
order_entity: "entities/order"
},
callback: function(constants) {
//console.log(constants.url);
//console.log("eeee");
}
};