MM-52536 Webpack unification part 2 (#23557)

* Remove unused bundle-loader

* Remove broken webpack-live-reload-plugin

* Remove unused terser-webpack-plugin

* Remove unused dotenv-webpack

* Update and share type definition for Webpack global values

* Share eslint-import-resolver-webpack

* Remove unused pmmmwh/react-refresh-webpack-plugin

* Remove webpack-cli/serve since it's already part of webpack-cli

* Remove unused Webpack packages from Components

* Share and update style-loader

* Remove unused image-webpack-loader from Boards
This commit is contained in:
Harrison Healey 2023-06-12 11:50:34 -04:00 committed by GitHub
parent c2417efc33
commit dfdc0e28d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 1237 deletions

View File

@ -38,7 +38,6 @@ const config = {
'^.+\\.(scss|css)$': '<rootDir>/src/test/style_mock.json', '^.+\\.(scss|css)$': '<rootDir>/src/test/style_mock.json',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js', '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(scss|css)$': '<rootDir>/__mocks__/styleMock.js', '\\.(scss|css)$': '<rootDir>/__mocks__/styleMock.js',
'^bundle-loader\\?lazy\\!(.*)$': '$1',
'^src(.*)$': '<rootDir>/src$1', '^src(.*)$': '<rootDir>/src$1',
'^i18n(.*)$': '<rootDir>/i18n$1', '^i18n(.*)$': '<rootDir>/i18n$1',
'^static(.*)$': '<rootDir>/static$1', '^static(.*)$': '<rootDir>/static$1',

View File

@ -89,7 +89,6 @@
"@types/redux-mock-store": "1.0.3", "@types/redux-mock-store": "1.0.3",
"@typescript-eslint/eslint-plugin": "5.57.1", "@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1", "@typescript-eslint/parser": "5.57.1",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-formatjs": "4.9.0", "eslint-plugin-formatjs": "4.9.0",
"eslint-plugin-header": "3.1.1", "eslint-plugin-header": "3.1.1",
@ -102,7 +101,6 @@
"eslint-plugin-unused-imports": "2.0.0", "eslint-plugin-unused-imports": "2.0.0",
"fetch-mock-jest": "1.5.1", "fetch-mock-jest": "1.5.1",
"identity-obj-proxy": "3.0.0", "identity-obj-proxy": "3.0.0",
"image-webpack-loader": "8.1.0",
"imagemin-gifsicle": "^7.0.0", "imagemin-gifsicle": "^7.0.0",
"imagemin-mozjpeg": "^10.0.0", "imagemin-mozjpeg": "^10.0.0",
"imagemin-optipng": "^8.0.0", "imagemin-optipng": "^8.0.0",
@ -119,7 +117,6 @@
"prettier": "^2.6.1", "prettier": "^2.6.1",
"redux-mock-store": "^1.5.4", "redux-mock-store": "^1.5.4",
"start-server-and-test": "^1.14.0", "start-server-and-test": "^1.14.0",
"style-loader": "3.3.1",
"stylelint": "^14.6.1", "stylelint": "^14.6.1",
"stylelint-config-sass-guidelines": "^9.0.1", "stylelint-config-sass-guidelines": "^9.0.1",
"ts-loader": "9.4.2", "ts-loader": "9.4.2",

View File

@ -30,7 +30,6 @@ const config = {
'identity-obj-proxy', 'identity-obj-proxy',
'^.+\\.(css|less|scss)$': 'identity-obj-proxy', '^.+\\.(css|less|scss)$': 'identity-obj-proxy',
'^.*i18n.*\\.(json)$': '<rootDir>/src/tests/i18n_mock.json', '^.*i18n.*\\.(json)$': '<rootDir>/src/tests/i18n_mock.json',
'^bundle-loader\\?lazy\\!(.*)$': '$1',
}, },
moduleDirectories: ['src', 'node_modules'], moduleDirectories: ['src', 'node_modules'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],

View File

@ -135,20 +135,16 @@
"@types/shallow-equals": "1.0.0", "@types/shallow-equals": "1.0.0",
"@types/styled-components": "5.1.24", "@types/styled-components": "5.1.24",
"@types/tinycolor2": "1.4.3", "@types/tinycolor2": "1.4.3",
"@types/webpack-env": "1.18.0",
"@typescript-eslint/eslint-plugin": "5.57.1", "@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1", "@typescript-eslint/parser": "5.57.1",
"babel-plugin-lodash": "3.3.4", "babel-plugin-lodash": "3.3.4",
"bundle-loader": "0.2.0",
"copy-webpack-plugin": "11.0.0", "copy-webpack-plugin": "11.0.0",
"dotenv-webpack": "8.0.1",
"emoji-datasource": "6.1.1", "emoji-datasource": "6.1.1",
"emoji-datasource-apple": "6.1.1", "emoji-datasource-apple": "6.1.1",
"emoji-datasource-google": "6.1.1", "emoji-datasource-google": "6.1.1",
"enzyme": "3.11.0", "enzyme": "3.11.0",
"enzyme-adapter-react-17-updated": "1.0.2", "enzyme-adapter-react-17-updated": "1.0.2",
"enzyme-to-json": "3.6.2", "enzyme-to-json": "3.6.2",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-plugin-header": "3.1.1", "eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.27.5", "eslint-plugin-import": "2.27.5",
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#5b0c972eacf19286e4c66221b39113bf8728a99e", "eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#5b0c972eacf19286e4c66221b39113bf8728a99e",
@ -172,7 +168,6 @@
"react-router-enzyme-context": "1.2.0", "react-router-enzyme-context": "1.2.0",
"redux-mock-store": "1.5.4", "redux-mock-store": "1.5.4",
"redux-persist-node-storage": "2.0.0", "redux-persist-node-storage": "2.0.0",
"style-loader": "3.0.0",
"stylelint": "13.13.1", "stylelint": "13.13.1",
"stylelint-config-idiomatic-order": "8.1.0", "stylelint-config-idiomatic-order": "8.1.0",
"stylelint-config-recommended": "5.0.0", "stylelint-config-recommended": "5.0.0",
@ -180,9 +175,7 @@
"stylelint-config-standard": "22.0.0", "stylelint-config-standard": "22.0.0",
"stylelint-order": "4.1.0", "stylelint-order": "4.1.0",
"stylelint-scss": "3.19.0", "stylelint-scss": "3.19.0",
"terser-webpack-plugin": "5.3.6",
"webpack-bundle-analyzer": "4.7.0", "webpack-bundle-analyzer": "4.7.0",
"webpack-livereload-plugin": "3.0.2",
"webpack-pwa-manifest": "4.3.0", "webpack-pwa-manifest": "4.3.0",
"yargs": "16.2.0", "yargs": "16.2.0",
"yup": "0.32.11" "yup": "0.32.11"

View File

@ -15,7 +15,6 @@ const {ModuleFederationPlugin} = require('webpack').container;
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest'); const WebpackPwaManifest = require('webpack-pwa-manifest');
const LiveReloadPlugin = require('webpack-livereload-plugin');
// const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer'); // const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
@ -413,9 +412,6 @@ if (DEV) {
const env = {}; const env = {};
if (DEV) { if (DEV) {
env.PUBLIC_PATH = JSON.stringify(publicPath); env.PUBLIC_PATH = JSON.stringify(publicPath);
if (process.env.MM_LIVE_RELOAD) {
config.plugins.push(new LiveReloadPlugin());
}
} else { } else {
env.NODE_ENV = JSON.stringify('production'); env.NODE_ENV = JSON.stringify('production');
} }

1220
webapp/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,7 @@
"@babel/preset-env": "7.21.5", "@babel/preset-env": "7.21.5",
"@babel/preset-react": "7.18.6", "@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.21.5", "@babel/preset-typescript": "7.21.5",
"@types/webpack-env": "1.18.1",
"babel-loader": "9.1.2", "babel-loader": "9.1.2",
"babel-plugin-formatjs": "10.5.1", "babel-plugin-formatjs": "10.5.1",
"babel-plugin-styled-components": "2.1.1", "babel-plugin-styled-components": "2.1.1",
@ -35,6 +36,7 @@
"cross-env": "7.0.3", "cross-env": "7.0.3",
"css-loader": "6.7.3", "css-loader": "6.7.3",
"eslint": "8.37.0", "eslint": "8.37.0",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-plugin-formatjs": "4.9.1", "eslint-plugin-formatjs": "4.9.1",
"mini-css-extract-plugin": "2.7.5", "mini-css-extract-plugin": "2.7.5",
"sass": "1.62.1", "sass": "1.62.1",

View File

@ -24,18 +24,12 @@
"@types/react-redux": "^7.1.21", "@types/react-redux": "^7.1.21",
"@types/shallow-equals": "^1.0.0", "@types/shallow-equals": "^1.0.0",
"@types/styled-components": "^5.1.19", "@types/styled-components": "^5.1.19",
"css-loader": "^6.7.1",
"rollup": "^2.75.7", "rollup": "^2.75.7",
"rollup-plugin-auto-external": "^2.0.0", "rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-scss": "^3.0.0", "rollup-plugin-scss": "^3.0.0",
"rollup-plugin-ts": "^2.0.5", "rollup-plugin-ts": "^2.0.5",
"sass": "^1.49.9", "typescript": "^4.3.4"
"sass-loader": "^12.6.0",
"style-loader": "^3.3.1",
"typescript": "^4.3.4",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2"
}, },
"peerDependencies": { "peerDependencies": {
"@babel/runtime-corejs3": "^7.17.8", "@babel/runtime-corejs3": "^7.17.8",

View File

@ -43,7 +43,6 @@
"@formatjs/cli": "4.7.0", "@formatjs/cli": "4.7.0",
"@graphql-codegen/cli": "2.16.3", "@graphql-codegen/cli": "2.16.3",
"@graphql-codegen/client-preset": "1.2.5", "@graphql-codegen/client-preset": "1.2.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
"@testing-library/react-hooks": "8.0.0", "@testing-library/react-hooks": "8.0.0",
"@types/debounce": "1.2.1", "@types/debounce": "1.2.1",
"@types/history": "4.7.8", "@types/history": "4.7.8",
@ -67,10 +66,8 @@
"@types/styled-components": "5.1.19", "@types/styled-components": "5.1.19",
"@typescript-eslint/eslint-plugin": "5.57.1", "@typescript-eslint/eslint-plugin": "5.57.1",
"@typescript-eslint/parser": "5.57.1", "@typescript-eslint/parser": "5.57.1",
"@webpack-cli/serve": "1.6.0",
"babel-plugin-add-react-displayname": "0.0.5", "babel-plugin-add-react-displayname": "0.0.5",
"classnames": "2.3.1", "classnames": "2.3.1",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-plugin-import": "2.25.4", "eslint-plugin-import": "2.25.4",
"eslint-plugin-import-newlines": "1.3.0", "eslint-plugin-import-newlines": "1.3.0",
"eslint-plugin-no-relative-import-paths": "1.5.0", "eslint-plugin-no-relative-import-paths": "1.5.0",
@ -86,7 +83,6 @@
"react-test-renderer": "17.0.2", "react-test-renderer": "17.0.2",
"redux-mock-store": "1.5.4", "redux-mock-store": "1.5.4",
"redux-thunk": "2.4.1", "redux-thunk": "2.4.1",
"style-loader": "3.3.1",
"ts-prune": "0.10.3" "ts-prune": "0.10.3"
}, },
"scripts": { "scripts": {