diff --git a/svgo.config.js b/svgo.config.js new file mode 100644 index 0000000..c665de0 --- /dev/null +++ b/svgo.config.js @@ -0,0 +1,10 @@ +module.exports = { + plugins: [ + { + name: 'inlineStyles', + params: { + onlyMatchedOnce: false + } + } + ] +} diff --git a/webpack.config.js b/webpack.config.js index df4df3c..45cf302 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,21 +2,13 @@ var path = require('path') const CopyPlugin = require('copy-webpack-plugin') const webpack = require('webpack') const fs = require('fs') -const SvgoInstance = require('svgo') +const { optimize } = require('svgo'); const entry = require('./package.json').main const readManifest = () => JSON.parse(fs.readFileSync(path.join(__dirname, './manifest.konnector'))) -const svgo = new SvgoInstance({ - plugins: [ - { - inlineStyles: { onlyMatchedOnce: false } - } - ] -}) - let iconName try { iconName = JSON.parse(fs.readFileSync('manifest.konnector', 'utf8')).icon @@ -61,7 +53,7 @@ module.exports = { function optimizeSVGIcon(buffer, path) { if (appIconRX && path.match(appIconRX)) { - return svgo.optimize(buffer).then(resp => resp.data) + return optimize(buffer).then(resp => resp.data) } else { return buffer }