-
-
Notifications
You must be signed in to change notification settings - Fork 733
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
Making pack:web
work by adding polyfill
#2678
Making pack:web
work by adding polyfill
#2678
Conversation
I think you still need to run |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
`buffer` doesn't have to be included through browserify
Head branch was pushed to by a user without write access
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…ills-to-pack-web # Conflicts: # yarn.lock
Head branch was pushed to by a user without write access
53906ad
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Making
pack:web
work by adding polyfillPull Request Type
Description
This PR makes the
pack:web
script work by adding the polyfill from browserify to webpack. This should effectively be the same thing as runningbrowserify
on the result of webpack; except that, it is way faster to build, and it won't bugger up the nice clean directory structure that webpack puts inInspect Element
in development builds. These things alone make this web build infinitely easier to debug and run than my existing web build.Screenshots
Before:
After:
Testing
yarn pack:web
will create all of the files needed for the web build, but since this web app needs to be hosted on a server and cannot be served directly off the filesystem, you will probably want to break out your favorite one liner likehttp-server
and navigate tohttp://127.0.0.1:8080/dist/web/index.html
.Desktop (please complete the following information):
Additional context
It may be worth noting, but there is code currently in the codebase which assumes that the application is in Electron if the environment is development. That code may have to be changed in the future if it would make sense to run the web build in development mode.
One major caveat of this solution is that it depends on bringing in two new packages
browserify@^17.0.0
andprocess@^0.11.10
. I don't see a way to achieve this without bringing in at least one new package or manually writing all of our own polyfill. Both of those solutions have their advantages and disadvantages.