How to prevent webpack/sass-loader from converting font URLs to data URIs? -
given following webpack v1 loader configuration ...
{ test: /\.scss$/, loader: extracttextplugin.extract('style-loader', 'css-loader!autoprefixer-loader!sass-loader'), },
... , importing bootstrap sass in main .scss file ...
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
... reason, bit bootstrap sass ...
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.woff2'), '#{$icon-font-path}#{$icon-font-name}.woff2')) format('woff2')
... gets converted to ...
url(data:application/font-woff2;base64,bw9kdwxllmv4cg9ydhmgpsbfx3dlynbhy2tfchvibgljx3bhdghfxyaricjmngy4zta2ndg0zjy2odqzywy0mzdhytc0n2q5nwywny53b2zmmii7) format("woff2")
... decodes to:
module.exports = __webpack_public_path__ + "f4f8e06484f66843af437aa747d95f07.woff2";
when expect/need is:
url("f4f8e06484f66843af437aa747d95f07.woff2") format("woff2")
Comments
Post a Comment