Webpacker: Why isn't webpack_compile_output enabled by default?

Created on 3 Oct 2019  路  7Comments  路  Source: rails/webpacker

How you doing guys.

I was wondering why isn't webpack_compile_output enabled by default. If webpack fails to compile your bundles you won't see anything unless you enable it. Compiling issues are so commonplace when working on code or deploying that it doesn't make sense to me to have all webpack output stripped out by default.

Would you guys consider having webpack_compile_output enabled by default? I think most people would benefit from that. Of course some devs may not want to see all the webpack output every time they do a change and refresh the browser, but they can always disable it.

good first issue help wanted

Most helpful comment

@jakeNiemiec just created this simple pr to add this modifications. Let me know if anything else is needed...

All 7 comments

Seeing how many 馃憤's https://github.com/rails/webpacker/issues/955#issuecomment-503830871 has, I think the users have spoken. Can someone create a PR?

https://github.com/rails/webpacker/blob/336077d2803bcd600731b4ab6a9411b488c1fc03/lib/install/config/webpacker.yml#L10


A different aspect of this that I am keen to revisit is https://github.com/rails/webpacker/pull/1834 by @yvbeek. I think errorDetails should also be true by default when in development:

https://github.com/rails/webpacker/blob/c4cf2e99c2ae4dffdd2942c1d2282936b8aaf36e/package/environments/development.js#L43

@jakeNiemiec just created this simple pr to add this modifications. Let me know if anything else is needed...

LGTM @LuanGB. Let's see what the maintainers have to say.

@jakeNiemiec @LuanGB are you guys using TypeScript with Webpacker?
It just seems to output so much info when errorDetails is true

Perhaps we can turn it back on for non-TypeScript projects?
Or can we somehow reduce the output to only the actual errors, not all that plugin noise?

If this is causing issues for a lot of people, please do set it to true by default.
However it would be nice to reduce all that output to useful information.

@yvbeek are you guys using TypeScript with Webpacker?

No

Or can we somehow reduce the output to only the actual errors, not all that plugin noise?

modules is still false in the PR, so this should not be an issue.

It just seems to output so much info when errorDetails is true

This only sets the default. We want users who are inexperienced with webpacker to have easy access to errors. With https://github.com/rails/webpacker/issues/955#, https://github.com/rails/webpacker/issues/2143#issuecomment-505038403, https://github.com/rails/webpacker/issues/2276, and others in mind, it seems like a better idea to default this to true for new installs. You can always change this in your webpacker.yml.

Annoying errors are better to have than silent errors. (and are easier to fix!)

I've just been banging my head at webpacker not injecting my imported CSS in rails 6. Enabling this option and restarting seems to have solved it. Might I ask what the advantage to having it off is?

I set it to true, but still don't get any log output?

Was this page helpful?
0 / 5 - 0 ratings