-
Notifications
You must be signed in to change notification settings - Fork 98
Implement an asset pipeline for CSS, JavaScript, and images #44
Comments
The same pipeline can be used to take our icons and inline them into our CSS |
@mattt This is the issue we discussed earlier, right? |
@kaishin Indeed it is. Any thoughts / opinions? |
So from what I gathered so far, here's what we want to achieve:
For 1, can we consider using Sass or PostCSS for taking care of things like auto-prefixing, polyfills, etc? For 2, I guess webpack is a good place to start. Not my favorite in terms of overhead, but we can try to keep the config manageable. For 3, I guess auto-generating the Swift file is one option. Any others that we can consider? |
Oh and we have also to decide how running webpack commands will fit in the workflow. Doing it manually is likely going to be error-prone. |
Here are a few options to consider: Option A: Add a call to Option B: Add Option C: Accept the possibility of stale assets in builds. Right now, I'm towards Option C. If you're working on the design of the HTML docs, you're almost certainly running The one situation where this would fail, though, is with conflict resolution. If I merge a PR that changes a source asset, I may need to re-run |
Absolutely. I have a slight preference for PostCSS if it's convenient, but Sass is fine too.
Actually, taking another look at the available options, I think Parcel looks a bit more palatable, at least for an MVP.
Alternatively, we can just copy the files into the built documentation directory, and have our HTML point to where they'll be. Inlining CSS was something I did primarily to get beta 1 out the door. |
Cool, I can set that up. It's my preference too.
Let's go with Parcel for now. I looked at it a while back and it seemed nicer.
I prefer this option as well. Keeps things tidy at a negligible cost.
C it is. I was going to pitch A initially but you bring up good points about the hard npm dependency. |
@mattt Can you assign me to this issue? Not able to do that myself... |
@kaishin Done. Have fun! |
@mattt Let's continue the discussion on the PR draft directly :) |
Package Resources offer a way to load CSS and JavaScript from the module bundle (as opposed to our current approach of hard-coding CSS in a string literal).
Although it looks like the "Package Manager Extensible Build Tools" proposal is no longer being considered, I think we should be able to leverage webpack (or any of its myriad colleagues) to generate resources on an as-needed basis.
The text was updated successfully, but these errors were encountered: