Closed shikelong closed 6 years ago
I also use postcss-assets. . I don't kown the inline function is postcss-url or postcss-assets's inline
@shikelong can you show postcss-url options?
It's my postcss-loader options.
{
loader: 'postcss-loader',
options: {
plugins: function () {
return [
require("postcss-import")({ path: ['./app'] }),
require("postcss-assets")({loadPaths: ['app/']}),
require("postcss-url")({}),
require("postcss-cssnext")(),
require("postcss-browser-reporter")(),
require("postcss-reporter")(),
];
}
}
}
Seem postcss-url use directory-encoder' SvgURIEncoder to encoded svg to dataUrl, And not use base64 to encode svg, instead of the optimizing encoding due to (https://codepen.io/tigt/post/optimizing-svgs-in-data-uris)
But In ie11, the optimizing encoding not work when the svg has style
tag.
The online demo: https://jsbin.com/rapucof/edit?html,css,output
Next is The inline svg 👍