Webpack-encore: Slow compiling when there are css urls

Created on 27 Jan 2018  路  4Comments  路  Source: symfony/webpack-encore

If I include some css code with url tags, speeds slow down excessively (3s --> 98s).

For example:

@font-face {
  font-family: MyFont;
  src: url('/fonts/myfont/font.woff2') format('woff2'), url('/fonts/myfont/font.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

I know that a similar problem was found on Mix: https://github.com/JeffreyWay/laravel-mix/issues/232

How can I disable resolving css urls (or solve this problem?)

Thanks

question

Most helpful comment

Hi @pensiero,

You can set the resolveUrlLoader option to false when calling enableSassLoader:

https://github.com/symfony/webpack-encore/blob/00e4051eb0ef18786a9d6abe2f9f2e73c887e8fa/index.js#L451-L466

All 4 comments

Hi @pensiero,

You can set the resolveUrlLoader option to false when calling enableSassLoader:

https://github.com/symfony/webpack-encore/blob/00e4051eb0ef18786a9d6abe2f9f2e73c887e8fa/index.js#L451-L466

Thanks so much @Lyrkan !

I save only 1 second 11.90 => 10.90 with resolveUrlLoader: false and Bootstrap Scss, is it normal please?

@Lyrkan thank you for your answer!

I had this option since the first time I tried Encore and I still see the assets files copied and versionned.

Was this page helpful?
0 / 5 - 0 ratings