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
Is your feature request related to a problem? Please describe.
With the help of egg-view-static in midway/egg ,ctx.render my server's HTML template。For example,midway create a server on port 6001, vite create a server on port 3000, in HTML Template, load js file as
<!-- if development -->
<script type="module" src="http://localhost:3000/@vite/client"></script>
<script type="module" src="http://localhost:3000/main.js"></script>
There is no problem.
but if I import jpg in tsx file, the asset url in js is /assets/xxx.png. The page will try to load localhost:6001/assets/xxx.png instead of localhost:3000/assets/xxx.png
Describe the solution you'd like
Add a configuration item, we can choose whether to use absolute path(include localhost:3000) in development mode, rather than relative path
Describe alternatives you've considered base support for 'DEV' env
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
With the help of
egg-view-static
in midway/egg ,ctx.render
my server's HTML template。For example,midway create a server on port 6001, vite create a server on port 3000, in HTML Template, load js file asThere is no problem.
but if I import jpg in
tsx
file, the asset url in js is/assets/xxx.png
. The page will try to loadlocalhost:6001/assets/xxx.png
instead oflocalhost:3000/assets/xxx.png
Describe the solution you'd like
Add a configuration item, we can choose whether to use absolute path(include
localhost:3000
) in development mode, rather than relative pathDescribe alternatives you've considered
base
support for 'DEV' envThe text was updated successfully, but these errors were encountered: