-
Notifications
You must be signed in to change notification settings - Fork 4
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
Switch from Webpack to Parcel for documentation site #11
Switch from Webpack to Parcel for documentation site #11
Conversation
2b48d78
to
f92c62d
Compare
@macklinu Dude this rocks! I'm a big fan of the idea of switching to Parcel, it's a tool I want to start using more for projects exactly like this. There is one problem i'm noticing though, which is that the production script is using the obfuscated function names for the hover states. You can see it in the deploy preview. I'm sure there's a way around this, but I won't have time to find it for at least a few days. Also, thank you for bringing my attention to |
I’ll take a look at that issue, thanks for pointing that out 👌 |
I think 4635f74 should fix the issue you were seeing by generating code documentation from the string name of the function (now passed into One other thing that might be nice is to add a Parcel plugin to clean the output directory before building. I noticed that successive every time I ran
|
Addressed cleaning the output directory before building in 1741c12. 👍 |
and add dashes back to ids #11
and add dashes back to ids
fixes a bug and bypasses an upstream parcel issue with not being able to use postcss-import
instead of package.json field
@macklinu I updated the markup function to add the spaces back in to the pattern names. I also realized that the text was breaking out of the swatches at certain breakpoints. This was because the custom breakpoints set in |
so they use the new browserslist
Thanks for fixing some issues I introduced in those changes. 😅 Curious what you think about this experiment (Webpack -> Parcel). For me, it was a little more error prone in ways I didn't expect, but there is less configuration, I think, so maybe a net win? 🤷♂️ Definitely points out some things that could be improved in Parcel (like that postcss issue you mentioned). |
I'm a really really big fan of Parcel's philosophy, but it definitely has some tradeoffs for DX. Like the But! This switch reduced the page weight by like 55%, which is magic. Anyhow, merged! Thanks so much for this. |
Hey @lowmess 👋 I was using this library the other week and started poking around at the source / documentation site. I was curious to switch things from Webpack to Parcel to see if that would make the site easier to build / contribute to, mostly out of curiosity. Thought I'd PR this to see if you're interested in this change (no pressure either way).
Overview of the changes:
parcel src/index.html
, and if Parcel finds any dependencies in that HTML file (likesrc/main.js
), it'll compile and bundle that code for you without any configuration. 😄colors.json
instead of having a separate prebuild step. This will effectively run the same color combos function at build time but uses the Babel build pipeline to generate this code instead of an explicit Node.js script. This removes two prebuild scripts inwww/package.json
.To test things locally:
cd www
andyarn
to install new dependencies for the documentation siteyarn start
to preview the documentation site at http://localhost:1234yarn build:min
to generate a production bundle (output towww/public
)