I have a directory structure which looks like the attached screen shot [![enter image description here][1]][1]
And then in the index.php file I am including require and my app file like this
<script type='text/javascript' data-main="js/config" src='node_modules/requirejs/require.js'></script>
<script type='text/javascript' src='js/app.js'></script>
Note: I have a package.json which, I am using for getting all the dependencies I am using for this project.
my cofig.js looks like this
requirejs.config({
baseUrl: "node_modules",
paths: {
jquery: "/jquery/dist/jquery.min"
}
});
The app.js looks like this.
define(['jquery'], function($){
//my code goes here
});
When I am loading my index.php I am getting this error in the console.
"require.js:165 Uncaught Error: Mismatched anonymous define() module: function ($){"
What am I doing wrong here? Super new to require so probably I am doing something really dumb