-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fix assets referenced in CSS not copied in prod builds #570
Conversation
🦋 Changeset detectedLatest commit: 18b8f00 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8fcbe3a
to
39faab6
Compare
Size Change: +325 B (0%) Total Size: 736 kB
ℹ️ View Unchanged
|
39faab6
to
d1635db
Compare
source = transformCss(source); | ||
} | ||
|
||
// Note: `plugin.generateBundle` is only called during prod builds for | ||
// CSS files. So we need to guard the url replacement code. | ||
if (production) { | ||
source = await transformCssImports(source, idRelative, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder for myself: would be cool to implement transformCssImports
within the transformCss
pass so that it can use the Stylis AST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@developit the middlewares in stylis
are expected to be synchronous, but our resolution mechanism is async. I'm not sure how we could avoid parsing the CSS twice with that restriction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point. It would have to be two-pass, which would be less than ideal.
d1635db
to
7eb0e5a
Compare
7eb0e5a
to
18b8f00
Compare
When an asset is referenced in a CSS file we didn't copy the files over to our output directory.