svelte-loader icon indicating copy to clipboard operation
svelte-loader copied to clipboard

Support thread loader by optional inline emitCss (base64, querystring)

Open non25 opened this issue 5 years ago • 3 comments

This option makes svelte-loader output base64'd css in querystring, which is always available to any thread. It is turned off by default because it pollutes webpack's console output, but if user needs to use thread-loader, he can.

non25 avatar Jan 17 '21 11:01 non25

Now it checks automatically. this.emitFile is not available in loaders spawned by thread-loader, so I'm using that.

non25 avatar Jan 17 '21 19:01 non25

So what do you think guys? I think adding this feature could be helpful. In default webpack configs it won't do anything, but people can start to experiment with thread-loader and tailwindcss and try to get better results in dev mode cold starts and in prod mode. If it would appear to be useless then we can safely remove it, because no API changes were made.

non25 avatar Jan 18 '21 09:01 non25

Interesting, it doesn't work with svelte-preprocess. I decided to try it with my scss preprocessed project and it tells me this stuff:

Thread Loader (Worker 0)
ParseError: Unexpected input (19:22)
17:   .button {
18:     $bgcol: hsl(215, 35%, 50%);
19:     background-color: $bgcol;
                          ^
20:     border: pxrem(1) solid mix(#000, $bgcol, 14);
21:     border-radius: pxrem(5);

So I guess we will release without this PR.

non25 avatar Jan 19 '21 06:01 non25