Answer the question
In order to leave comments, you need to log in
How to connect two requaers to a page so that they don't conflict!?
Good afternoon, according to the documentation, there can only be one entry point per page
<script data-main="scripts/main" src="scripts/requireJS.js"></script>
<script type="text/javascript" src="scripts/requireJS.js"></script>
<script type="text/javascript" src="scripts/main.js"></script>
var reqOne = requirejs.config({
contex: 'v1',
baseUrl: 'lib',
paths: {'v': 'version1'},
waitSeconds: 5
});
reqOne(['require','v'], (require, ver) => {
console.log( 'VERSION 1 is ', ver.version);
});
var reqTwo = requirejs.config({
contex: 'v2',
baseUrl: 'lib2',
paths: { 'vTwo': 'version2' }
});
reqTwo(['require', 'vTwo'], (require, v) => {
console.log('VERSION 2 is ', ver.version)
});
Answer the question
In order to leave comments, you need to log in
I connected it, I just wrote the parameter in the requester config "contex" instead of "context" correctly :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question