Add optimizeSvgEncode option

This commit is contained in:
Dmitry Filatov
2019-02-22 18:09:41 +03:00
parent a119e48b59
commit a51e3b694f
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -84,6 +84,13 @@ declare namespace url {
*/
ignoreFragmentWarning?: boolean;
/**
* Reduce size of inlined svg (IE9+, Android 3+)
*
* @default false
*/
optimizeSvgEncode?: boolean;
/**
* Determine wether a file should be inlined.
*/
+1 -1
View File
@@ -7,7 +7,7 @@ const single: postcss.Transformer = url({ url: 'copy', assetsPath: 'img', useHas
const multiple: postcss.Transformer = url([
{ filter: '**/assets/copy/*.png', url: 'copy', assetsPath: 'img', useHash: true },
{ filter: '**/assets/inline/*.svg', url: 'inline' },
{ filter: '**/assets/inline/*.svg', url: 'inline', optimizeSvgEncode: true },
{ filter: '**/assets/**/*.gif', url: 'rebase' },
{ filter: 'cdn/**/*', url: (asset) => `https://cdn.url/${asset.url}` },
]);