chore: FIT-14: Ensure production deployment of playground is resolvable as a subpath redirect #7595
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces updates to the
playground
application to adjust its output structure, enhance environment-specific configurations, and improve the Webpack build process. The key changes include modifying the output paths and base hrefs, updating environment variables for standalone modes, and refining Webpack's configuration logic to support the new setup.Changes to output structure and base hrefs:
outputPath
inweb/apps/playground/project.json
to include aplayground-assets
subdirectory, and added specificbaseHref
values for development ("/"
) and production ("/playground-assets/"
) environments. [1] [2] [3]Updates to environment variables and scripts:
MODE
environment variable inweb/package.json
scripts from"standalone"
to"standalone-playground"
, and added a post-build step to move theindex.html
file to the correct directory.Refinements to Webpack configuration:
optimizer
andentry
logic to useprocess.env.MODE.startsWith("standalone")
instead of strict equality checks, ensuring compatibility with the newstandalone-playground
mode. [1] [2]publicPath
in Webpack's output configuration to dynamically set the path based on whether the mode isstandalone-playground
.devServer
configuration in Webpack to handle standalone modes using a more flexible condition.