I have a link like this: http://www.example.com/product/ (Product is the name of my application in the server for accessing it under the main website).
When working with MVC and including files such as CSS stylesheets in the head section, I usually use "~/Content/style.css".
Now, in SystemJS, I am facing an issue while trying to import my main.js file located in "Scripts/code/main.js". I need to reference it with my application name (product mentioned above).
Currently, my code snippet looks like this:
<script>
System.config({
packages: {
'./Scripts/code': {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('./Scripts/code/main.js').then(null, console.error.bind(console));
</script>
The problem is that it is looking at the root directory, attempting to access www.example.com/Scripts/code/main.js instead of www.example.com/product/Scripts/code/main.js.
I don't want to hardcode the application name in the URL as it may vary or not exist. Can anyone assist me in accessing the correct path?