carbon-preprocess-svelte 0.11.6 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/plugins/OptimizeCssPlugin.js +3 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -53,8 +53,8 @@ The preprocessor optimizes imports from the following packages:
|
|
|
53
53
|
|
|
54
54
|
> [!NOTE]
|
|
55
55
|
> When this preprocessor was first created, there was no workaround to optimize slow cold start times with Vite in development.
|
|
56
|
-
>
|
|
57
|
-
> However, this preprocessor is still useful for non-Vite bundlers, like Rollup and Webpack.
|
|
56
|
+
> Today, [@sveltejs/vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte) enables [`prebundleSvelteLibraries: true`](https://github.com/sveltejs/vite-plugin-svelte/blob/ba4ac32cf5c3e9c048d1ac430c1091ca08eaa130/docs/config.md#prebundlesveltelibraries) by default.
|
|
57
|
+
> However, this preprocessor is still useful for non-Vite bundlers, like Rollup and Webpack. Also, it can further improve cold start development times even with `prebundleSvelteLibraries: true`.
|
|
58
58
|
|
|
59
59
|
#### SvelteKit
|
|
60
60
|
|
|
@@ -33,7 +33,9 @@ class OptimizeCssPlugin {
|
|
|
33
33
|
for (const [id] of Object.entries(assets)) {
|
|
34
34
|
if ((0, utils_1.isCssFile)(id)) {
|
|
35
35
|
const original_css = assets[id].source();
|
|
36
|
-
const optimized_css = (0, create_optimized_css_1.createOptimizedCss)(Object.assign(Object.assign({}, this.options), { source: original_css
|
|
36
|
+
const optimized_css = (0, create_optimized_css_1.createOptimizedCss)(Object.assign(Object.assign({}, this.options), { source: Buffer.isBuffer(original_css)
|
|
37
|
+
? original_css.toString()
|
|
38
|
+
: original_css, ids }));
|
|
37
39
|
compilation.updateAsset(id, new RawSource(optimized_css));
|
|
38
40
|
if (this.options.verbose) {
|
|
39
41
|
(0, print_diff_1.printDiff)({ original_css, optimized_css, id });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-preprocess-svelte",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Svelte preprocessors for the Carbon Design System",
|
|
6
6
|
"author": "Eric Liu (https://github.com/metonym)",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"estree-walker": "^2.0.2",
|
|
11
11
|
"magic-string": "^0.30.11",
|
|
12
|
-
"postcss": "^8.4.
|
|
13
|
-
"postcss-discard-empty": "^
|
|
12
|
+
"postcss": "^8.4.47",
|
|
13
|
+
"postcss-discard-empty": "^7.0.0"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|