Skip to content

Commit e353a4c

Browse files
committed
Adjust readme
1 parent 3a49db4 commit e353a4c

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

README.md

+4-17
Original file line numberDiff line numberDiff line change
@@ -278,26 +278,13 @@ module.exports = {
278278

279279
## Using svelte-loader in combination with thread-loader
280280

281-
There is a way to make `svelte-loader` support `thread-loader`.
281+
By default `svelte-loader` uses a Map to store css, and passes keys to that Map through custom loader string in query parameter.
282282

283-
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.
283+
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.
284284

285-
This will make console output unpleasant to look at, but `thread-loader` will have access to the css data it needs to function properly.
285+
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.
286286

287-
```javascript
288-
...
289-
{
290-
test: /\.(html|svelte)$/,
291-
exclude: /node_modules/,
292-
use: {
293-
loader: 'svelte-loader',
294-
options: {
295-
inlineCss: true,
296-
},
297-
},
298-
},
299-
...
300-
```
287+
It will clutter the console output, but you will gain compilation speed, especially when using `tailwindcss` with `@apply` through `svelte-preprocess`.
301288

302289
## License
303290

0 commit comments

Comments
 (0)