-
Notifications
You must be signed in to change notification settings - Fork 3
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
add onlyIfDevelopment entry file for easier webpack config #9
base: master
Are you sure you want to change the base?
Conversation
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.
Looks pretty good.
Sorry it took a couple of days for me to get around to looking this over!
I'll give it a quick test with using entry
, but aside from the two requested changes, it's looking pretty good!
I think this was based off the use of Having not had much experience with I'm happy to defer to you for advise on the best way to handle the entry side of things 😃 |
1c93ee4
to
a001383
Compare
- add documentation for this option and leave the previous installation docs as an alternative "custom installation"
a001383
to
fe8c5cb
Compare
Committed a new revision that should change it to |
- as doing so will break hot reloading for the default settings - add link to the relevant webpack-serve issue & comment
Added a new commit with an addition to the docs regarding the hot reloading problem that occurs when this is the first entry |
- should make the hot reload problem harder to stumble upon by making the intended entry config more explicit
docs as an alternative "custom installation"
I based the docs off of the previous commit that mentioned entry files, with a few modifications:
entry
config since it's a bit of an advanced topicrequire.resolve
as I don't believe it's necessary (I didn't need to use it in my webpack config, though I'm not sure if there's a circumstance in which it would be necessary)Sorry, my formatter removed whitespace at the end of lines automatically, I can remove those from the commit if needed.
Having looked at the past docs commit, I can see that my usage is a bit different than the way you've used it / seen it. I didn't add a new entry (and therefore no new
<script>
tag), I added it to the array in my entry, i.e.See the link above for full context in my boilerplate repo.
EDIT: I definitely think having it as a separate / new entry is the ideal usage as separate entrypoints / script tags ensures the overlay always shows up as its separate, isolated bundle will never fail to compile. In that case, excluding the overlay script tag from production HTML would also be ideal to have as little production impact as possible. Even with
onlyIfProduction
, webpack's bundling code will still create a tiny bundle of JS that does nothing (not optimal, but not particularly harmful either).Related to #5