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
Using the default @snowpack/app-template-react-typescript, and setting baseUrl in snowpack.config.json seems to create an import for env.js in _dist_/index.js (in the built directory) that's includes the baseUrl when it doesn't need to.
the built artifacts will be inside build/. I then move the build folder to the root of the webserver, and rename it to static, such that (from root), the folder structure looks like this (the frontend is served from http://WEBSERVER_URL/static:
However, the built _dist_/index.js starts with the following import:
import b from"../static/__snowpack__/env.js";
As I understand, the static is attached because baseUrl has been set to static, but even if this is the case, the path is incorrect.
index.js is inside _dist_, so this relative path would become (as an absolute path from the webserver root) /static/static/__snowpack__/env.js. Another way of looking at it is that the _dist_ folder is a sibling of __snowpack__, so either an extra .. needs to be added to this, or the static needs to be dropped.
Unless I'm just misunderstanding how baseUrl is designed to be used, please let me know if I'm making an incorrect assumption somewhere.
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
-
Using the default
@snowpack/app-template-react-typescript
, and settingbaseUrl
insnowpack.config.json
seems to create an import forenv.js
in_dist_/index.js
(in the built directory) that's includes thebaseUrl
when it doesn't need to.snowpack.config.json
looks like this:the built artifacts will be inside
build/
. I then move thebuild
folder to the root of the webserver, and rename it tostatic
, such that (from root), the folder structure looks like this (the frontend is served fromhttp://WEBSERVER_URL/static
:However, the built
_dist_/index.js
starts with the following import:As I understand, the
static
is attached becausebaseUrl
has been set tostatic
, but even if this is the case, the path is incorrect.index.js
is inside_dist_
, so this relative path would become (as an absolute path from the webserver root)/static/static/__snowpack__/env.js
. Another way of looking at it is that the_dist_
folder is a sibling of__snowpack__
, so either an extra..
needs to be added to this, or thestatic
needs to be dropped.Unless I'm just misunderstanding how
baseUrl
is designed to be used, please let me know if I'm making an incorrect assumption somewhere.Beta Was this translation helpful? Give feedback.
All reactions