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 and output. 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.
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 setassetFileNames: "[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 setsourcemap: 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.