In my HTML file, I included a script like:
<script src=js/index.js></script>
In my script, I try to add a configuration.js
file just by writing const Configuration = require(./configuration);
. configuration.js
is in the same folder with index.js
. But on console it says:
Uncaught Error: Cannot find module './configuration'
configuration.js and index.js files are both in /app/js/
folder.
What is a solution to that? I can include Node.js modules like Lodash for example.