Skip to content

Commit 138e31c

Browse files
authored
fix(gen-rollup-conf): don't create CSS maps for standalone (#158)
The CSS is injected into JS with the sourcemaps. This bloats the files without much of a benefit (they would be very rarly used, most people won't use them at all). Saves about 50 KiB (~10%) from minified Vis Timeline. Sourcemaps are still generated for CSS files as they're external with very little added to the CSS file itself.
1 parent c5e0f87 commit 138e31c

File tree

1 file changed

+2
-1
lines changed
  • src/module/generate-rollup-configuration

1 file changed

+2
-1
lines changed

src/module/generate-rollup-configuration/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ const generateRollupPluginArray = (
265265
extract: !injectCSS && `styles/${fullLibraryFilename}.css`,
266266
inject: injectCSS,
267267
minimize,
268-
sourceMap: true,
268+
// Prevent the sourcemaps from being injected into JS files.
269+
sourceMap: !injectCSS,
269270
plugins: [
270271
postcssAssetsPlugin({
271272
loadPaths: [assets]

0 commit comments

Comments
 (0)