-
-
Notifications
You must be signed in to change notification settings - Fork 81
breaking: Css Writer #136
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
breaking: Css Writer #136
Conversation
- will respect Rollup's `output` naming conventions
- do not emit sourcemap if Rollup told not to - synchronize hashed output filename
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.
lgtm
@@ -64,6 +55,12 @@ interface Options { | |||
// } | |||
// }, | |||
|
|||
/** | |||
* Add extra code for development and debugging purposes. |
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.
I think this doesn't really add "extra code", but pretty prints the sourcemap
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.
For this plugin, yes, but it's forwarded to svelte/compiler
:: https://svelte.dev/docs#svelte_compile
It's really a few fixes, but it since it is a change in the default behavior, safer to just call this breaking.
Doing so means we can also allow #126 to land (re: compatibility concerns) and take this opportunity to finally (!) declare useful peer dependency constraints, including Rollup@2x. (Fixing those can be a separate PR) Edit: #138
Changes
Our CSS Writer is broken. While it does work, it's not entirely useful given its environment. As of today (before this PR), the
CssWriter
class:Completely ignores
output.assetFileNames
, forcing"bundle.css"
as your final output, even though all other assets/chunks will/are (likely) configured to have hashed filenames.To go back to previous behavior, in their Rollup config, one must set
assetFileNames: "[name].[ext]"
or pass a function to customize the output naming format selectively.Completely ignores
output.sourcemap
andoutput. sourcemapExcludeSources
, which means that we force the emitted CSS files to have sourcemaps, even if we told Rollup to disable sourcemaps outright.To go back to previous behavior, in their Rollup config, one must set
sourcemap: true
– sources are included by default.Always prints expanded sourcemaps (aka, multiline JSON). While super minor, there's no reason to go this with production (non-
dev
) output.I included tests that ensure all these options are respected. And I made sure that when using hashed asset names (Rollup's default), that the sourcemap and CSS file correctly reference each other's hashed names.