You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone!
My problem is that when I build a single file, it handles the URL specified in the "base" parameter perfectly. However, when I build two files, each including a file named "core.js" it seems like the "base" parameter is not used. The "modulepreload" disappears from the built files. (e.g.: const scriptRel="modulepreload",assetsURL=function(e){return"http://localhost.test/build/"+e%7D)
Is there a way to solve this so that the shared files are also loaded with modulepreload?
Every input file imports a core.js file. import coreApp from './core.js';
This is necessary because both of my input files can be used independently, but they need to contain the core elements.
This is how I use my built files (which is perfect for a single input file) This request is processed by a backend server, which responds with the content of the appropriate JS file:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone!
My problem is that when I build a single file, it handles the URL specified in the "base" parameter perfectly. However, when I build two files, each including a file named "core.js" it seems like the "base" parameter is not used. The "modulepreload" disappears from the built files. (e.g.: const scriptRel="modulepreload",assetsURL=function(e){return"http://localhost.test/build/"+e%7D)
Is there a way to solve this so that the shared files are also loaded with modulepreload?
My vite.config:
Every input file imports a core.js file. import coreApp from './core.js';
This is necessary because both of my input files can be used independently, but they need to contain the core elements.
This is how I use my built files (which is perfect for a single input file) This request is processed by a backend server, which responds with the content of the appropriate JS file:
When I have only one input file, the beginning of that file looks like this:
Since I have multiple inputs, this changes and the assets URL disappears from it:
Beta Was this translation helpful? Give feedback.
All reactions