feat: configure webpack-dev-server for independent frontend development [reboot of #1999] #2207
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.
Fixes #1348
Credit for this code goes to @hydrosquall's PR #1999.
Changes:
I merged the current
develop
branch into that branch and fixed the conflicts.I also made some changes to how the vars are passed from the config to the
index.html
to ensure that we getboolean
true
/false
values instead of string'true'
. It's possible to inject the variables directly into the<script>
withwindow.process.env = <%= ENV_FROM_WEBPACK %>
but that is a syntax error if the file is accessed directly. It seemed safer to place the variables into an HTML property and read from the HTML to the JS, so that's what I did.This development environment can only load the IDE and cannot handle login, saving, or even viewing the p5 examples. The next step will be to interact with with an API from the production site or a staging site. I see that PR #1398 was merged in order to allow this, but I'm still getting CORS errors 🤷
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123