如何防止webpack / sass-loader将字体URL转换为数据URI?

时间:2017-03-28 14:19:58

标签: webpack bootstrap-sass sass-loader

给出以下webpack v1加载程序配置...

{
    test: /\.scss$/,
    loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader!sass-loader'),
},

...只需在我的主.scss文件中导入bootstrap sass ......

@import "~bootstrap-sass/assets/stylesheets/bootstrap";

...出于某种原因,这一点来自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')

...转换为此...

url(data:application/font-woff2;base64,bW9kdWxlLmV4cG9ydHMgPSBfX3dlYnBhY2tfcHVibGljX3BhdGhfXyArICJmNGY4ZTA2NDg0ZjY2ODQzYWY0MzdhYTc0N2Q5NWYwNy53b2ZmMiI7) format("woff2")

...解码为:

module.exports = __webpack_public_path__ + "f4f8e06484f66843af437aa747d95f07.woff2";

当我期望/需要的是:

url("f4f8e06484f66843af437aa747d95f07.woff2") format("woff2")

0 个答案:

没有答案