You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+4-17
Original file line number
Diff line number
Diff line change
@@ -351,26 +351,13 @@ This ensures that global css is being processed with `postcss` through webpack r
351
351
352
352
## Using svelte-loader in combination with thread-loader
353
353
354
-
There is a way to make `svelte-loader` support `thread-loader`.
354
+
By default `svelte-loader` uses a Map to store css, and passes keys to that Map through custom loader string in query parameter.
355
355
356
-
Enable `inlineCss: true` in options as shown below. It will make `svelte-loader`output component css in base64 as a query string to webpack, instead of saving it to a Map, and passing key to that map.
356
+
This won't work for multiple `thread-loader` processess. `css-loader`won't find component's css in a Map that is located in other process.
357
357
358
-
This will make console output unpleasant to look at, but `thread-loader`will have access to the css data it needs to function properly.
358
+
If you set up `thread-loader` on top of `svelte-loader`however, it will pass whole base64'd css in a query, without using Map.
359
359
360
-
```javascript
361
-
...
362
-
{
363
-
test:/\.(html|svelte)$/,
364
-
exclude:/node_modules/,
365
-
use: {
366
-
loader:'svelte-loader',
367
-
options: {
368
-
inlineCss:true,
369
-
},
370
-
},
371
-
},
372
-
...
373
-
```
360
+
It will clutter the console output, but you will gain compilation speed, especially when using `tailwindcss` with `@apply` through `svelte-preprocess`.
0 commit comments