From cfdb649ae18e25925dcc3c4acee6bc76754cc025 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 7 Mar 2023 12:23:18 +0300 Subject: Fix legacy build --- package-lock.json | 62 ------------------------------------------------- package.json | 1 - src/main/assets/icon.js | 4 +++- webpack.config.js | 16 ++++++------- 4 files changed, 11 insertions(+), 72 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a60b901..a77aca9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,6 @@ "@typescript-eslint/eslint-plugin": "^5.54.1", "autoprefixer": "^10.4.13", "babel-loader": "^9.1.2", - "copy-webpack-plugin": "^11.0.0", "core-js": "^3.29.0", "cross-env": "^7.0.3", "css-loader": "^6.7.3", @@ -6378,42 +6377,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "node_modules/copy-webpack-plugin": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", - "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", - "dev": true, - "dependencies": { - "fast-glob": "^3.2.11", - "glob-parent": "^6.0.1", - "globby": "^13.1.1", - "normalize-path": "^3.0.0", - "schema-utils": "^4.0.0", - "serialize-javascript": "^6.0.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "webpack": "^5.1.0" - } - }, - "node_modules/copy-webpack-plugin/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/core-js": { "version": "3.29.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.29.0.tgz", @@ -22793,31 +22756,6 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "copy-webpack-plugin": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz", - "integrity": "sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==", - "dev": true, - "requires": { - "fast-glob": "^3.2.11", - "glob-parent": "^6.0.1", - "globby": "^13.1.1", - "normalize-path": "^3.0.0", - "schema-utils": "^4.0.0", - "serialize-javascript": "^6.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - } - } - }, "core-js": { "version": "3.29.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.29.0.tgz", diff --git a/package.json b/package.json index e91a9622..89ca19b3 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "@typescript-eslint/eslint-plugin": "^5.54.1", "autoprefixer": "^10.4.13", "babel-loader": "^9.1.2", - "copy-webpack-plugin": "^11.0.0", "core-js": "^3.29.0", "cross-env": "^7.0.3", "css-loader": "^6.7.3", diff --git a/src/main/assets/icon.js b/src/main/assets/icon.js index 6ff95001..6ab3cd81 100644 --- a/src/main/assets/icon.js +++ b/src/main/assets/icon.js @@ -1,8 +1,10 @@ +import evilIcons from 'evil-icons/assets/sprite.svg'; + function icon(name, { size = '', className = '' }) { const classes = `icon icon--${name} icon--${size} ${className}`.trim(); var icon = '' + - '' + + `` + ''; var html = '
' + diff --git a/webpack.config.js b/webpack.config.js index c94ca661..7361552b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const ESLintPlugin = require('eslint-webpack-plugin'); -const CopyPlugin = require('copy-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); @@ -63,15 +62,16 @@ module.exports = (env, argv) => { }, }, ], + }, { + test: /\.(png|jpe?g|gif|svg)$/i, + use: [ + { + loader: 'file-loader', + }, + ], }] }, plugins: [ - new CopyPlugin({ - patterns: [{ - from: __dirname + '/node_modules/evil-icons/assets/sprite.svg', - to: __dirname + '/src/main/resources/static/' - }], - }), ], resolve: { symlinks: false, @@ -88,7 +88,7 @@ module.exports = (env, argv) => { fix: false })); } else { - config.plugins.push(new MiniCssExtractPlugin()); + config.plugins.push(new MiniCssExtractPlugin({ filename: 'style.css' })); } config.optimization = { minimize: !dev, -- cgit v1.2.3