Skip to content
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

View webpack.config final output #63

Closed
SagiMedina opened this issue Jul 31, 2019 · 2 comments
Closed

View webpack.config final output #63

SagiMedina opened this issue Jul 31, 2019 · 2 comments

Comments

@SagiMedina
Copy link
Contributor

SagiMedina commented Jul 31, 2019

It would be nice if one can see the final output of the Webpack configuration

@KidkArolis
Copy link
Owner

This is somewhat tricky in principle. There are a few options

a) Show the code that generates config (not the config itself) in a copy/pasteable way such that you could copy this code into your webpack.config.js and start tweaking. This is related to creating unstrap command: #5.

b) Show the final generated config (so no loops, conditions, etc. just the final output), but swap in all of the functions (e.g. include: filepath => !!condition), classes (e.g. new Terser) or other non serialisable JSON things as code strings, somehow.. Tricky.

c) Just print as is using node's util.inspect, which means some things will look like include: [Function: include],.

Option c) is the simplest and I while might not be as useful as say a) which you'd use for "ejecting" jetpack, it can still be very useful for debugging issues. So I've added that for now in 0.17.0! E.g.:

jetpack -i # for inspect config.. or pr*i*nt config
jetpack --print-config
jetpack --print-config --legacy
jetpack build --print-config
jetpack build --print-config --modern
jetpack build --print-config --legacy

image

@KidkArolis
Copy link
Owner

Hm, should have maybe named it --show-config, oh well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants