-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(framework): make assets path configurable #2214
Conversation
I think this would also resolves the 2nd part of this issue #2169 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two minor documentation fixes, otherwise looks good
README.md
Outdated
@@ -168,6 +168,8 @@ yarn build # to build the project | |||
Afterwards, you can find the build output in the `dist` folder of the corresponding package folder. | |||
For example, to find the Button component (that belongs to the `main` package), look inside the `packages/main/dist` folder. | |||
|
|||
*Note: before building the project you can also set the `PUBLIC_DEPLOY_PATH` environment variable to specify the path where non-bundled assets will be fetched from* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is DEPLOY_PUBLIC_PATH
@@ -168,6 +168,8 @@ yarn build # to build the project | |||
Afterwards, you can find the build output in the `dist` folder of the corresponding package folder. | |||
For example, to find the Button component (that belongs to the `main` package), look inside the `packages/main/dist` folder. | |||
|
|||
*Note: before building the project you can also set the `PUBLIC_DEPLOY_PATH` environment variable to specify the path where non-bundled assets will be fetched from* | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add the example from the commit description in the docs
DEPLOY_PUBLIC_PATH="\/my\/resources\/" yarn build
note however that this gives the wrong result on mac (when reading from nodejs)
DEPLOY_PUBLIC_PATH: '\\/my\\/resources\\/'
This has been a highly requested feature for a long time. Although resource path is a build-time artefact, it often makes sense to build once and deploy in multiple, previously unknown directories.
Changes:
assetsPath
DEPLOY_PUBLIC_PATH
or to useassetsPath
at runtime (or both).Option1: build-time
(for Windows:
DEPLOY_PUBLIC_PATH="\/my\/resources\/" yarn build
)Option2: runtime
BREAKING CHANGE: Running the production build command:
yarn build
will now generate the.json
resources asset paths without/resources/
in the beginning. Theyarn start
command remains unchanged - it will implicitly setDEPLOY_PUBLIC_PATH
to/resources/
as before.Before the change, the build generates for example:
After the change, without setting
DEPLOY_PUBLIC_PATH
it will generate:In order to have the old
yarn build
behavior run:(for Windows:
DEPLOY_PUBLIC_PATH="\/resources\/" yarn build
)closes: #2167
closes: #2169
related to: #2205