I have followed the instructions in the documentation to include requirejs using the data-main
entry point. You can find more information here in the docs.
<script data-main="js/app-main" src="js/lib/require.js"></script>
The contents of my app-main.js file are as follows:
requirejs.config({
baseUrl: 'js/myapp/',
...
});
requirejs(['main']);
I am looking for a way to separate the require configuration from the main execution, allowing me to share the config between different environments such as production and testing.
To achieve this, I need to create an app.js file (containing configuration only):
requirejs.config({
baseUrl: 'js/myapp/',
...
});
In addition, I require a main.js file which initiates the app execution (but should not be included in the testing environment).
How can I properly include these two files using a single data-main
entry point?
I attempted to use an app-main.js file with require(['app','main']);
but encountered issues.