Add css.Build (using ESBuild to transform CSS resources)#14610
Add css.Build (using ESBuild to transform CSS resources)#14610bep wants to merge 1 commit intogohugoio:masterfrom
Conversation
379cb16 to
881d5fd
Compare
55717df to
8b2ecf5
Compare
|
Request: According to the esbuild docs, Question: For the EDIT: It would be great to be able to use browserslist instead of having to update targets over time. |
|
I wanted to create a simple "loaders" example for the docs: Without any loaders, with this CSS: body {
background: url('../images/circle.png') no-repeat center center fixed;
}I get this:
I think As a guess, I defined a loader for That works great. But for a larger file I may not want to embed the data. So I tried this: But then the published CSS file ( Admittedly I have zero experience with this, so there may be a better way to handle it, but I'm wondering if we want a default map of loaders for common file formats. This assumes that we could somehow make the |
I'm not totally sure. It makes the option parsing/documentation fuzzy. These are 2 very distinct things in the ESBuild Go API and target (one value, e.g. ES2020) is a JavaScript only option. EDIT in: Yes, I will rename it to
I agree, I will do more testing on this today. Thanks for your detailed feedback. |
8b2ecf5 to
96519f2
Compare
Fixes gohugoio#14609 Fixes gohugoio#14613
96519f2 to
f918bac
Compare
|
@jmooring have added a list of checkboxes in the first comment; if it's checked it means that I have force pushed a fix. |
It's not documented, but that seems to be the behavior.
Yea, (big) maybe. The great thing about this particular new feature is that it does not (or: it does not have to) depend on any extra mumbo jumbo (e.g. |
enginesoption: Slice, or engine/version combined, e.g.chrome58... EsBuild has 1 target and multiple engines put into one flag: https://esbuild.github.io/api/#target I think it makes most sense for us to split it, which matches the Go API. I need to check what the sensible default here is, but for CSS the relevance is syntax transforms and browser prefixes.Fixes #14609
Notes for docs
All relevant options:
TODOs
loadersfor CSS, refUnexpected "\x89"fileloader do a sensible thing. Note that this fix also would be relevant to JS.target.noneto sourcemap opts.