From aa5145973a1fe331c06fae5713690ba4eb2df531 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 24 Mar 2021 21:24:35 +0300 Subject: webpack: copy sprite.svg to destination --- webpack.config.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index 8ec5a68b..c2d0dd4e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const ESLintPlugin = require('eslint-webpack-plugin'); +const CopyPlugin = require('copy-webpack-plugin'); module.exports = (env, argv) => { const dev = argv.mode !== 'production'; @@ -23,7 +24,6 @@ module.exports = (env, argv) => { 'core-js/modules/web.dom-collections.iterator', __dirname + '/src/main/assets/scripts.js', __dirname + '/src/main/assets/style.css', - 'evil-icons/assets/sprite.svg', 'evil-icons/assets/evil-icons.css' ] }, @@ -50,7 +50,7 @@ module.exports = (env, argv) => { postcssOptions: { plugins: [ 'stylelint', - ['postcss-preset-env', { stage: 0 } ] + ['postcss-preset-env', { stage: 0 }] ] } } @@ -65,7 +65,13 @@ module.exports = (env, argv) => { }, plugins: [ new MiniCssExtractPlugin({ filename: 'style.css' }), - new ESLintPlugin({ files: 'src/main/assets', lintDirtyModulesOnly: true, failOnWarning: false, failOnError: true, fix: false }) + new ESLintPlugin({ files: 'src/main/assets', lintDirtyModulesOnly: true, failOnWarning: false, failOnError: true, fix: false }), + new CopyPlugin({ + patterns: [{ + from: __dirname + '/node_modules/evil-icons/assets/sprite.svg', + to: __dirname + '/src/main/resources/static/' + }], + }), ], }; if (!dev) { -- cgit v1.2.3