Merge pull request #13894 from desktop/bump-webpack

Bump Webpack to 5.68.0
This commit is contained in:
Sergio Padrino 2022-03-02 17:56:18 +01:00 committed by GitHub
commit 424f6c802a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 700 additions and 1679 deletions

View file

@ -1,6 +1,5 @@
import * as path from 'path'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import CleanWebpackPlugin from 'clean-webpack-plugin'
import webpack from 'webpack'
import merge from 'webpack-merge'
import { getChannel } from '../script/dist-info'
@ -18,13 +17,16 @@ export const replacements = getReplacements()
const commonConfig: webpack.Configuration = {
optimization: {
noEmitOnErrors: true,
emitOnErrors: false,
},
externals: externals,
output: {
filename: '[name].js',
path: path.resolve(__dirname, '..', outputDir),
libraryTarget: 'commonjs2',
library: {
name: '[name]',
type: 'commonjs2',
},
},
module: {
rules: [
@ -48,10 +50,12 @@ const commonConfig: webpack.Configuration = {
],
},
plugins: [
new CleanWebpackPlugin([outputDir], { verbose: false }),
// This saves us a bunch of bytes by pruning locales (which we don't use)
// from moment.
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/,
}),
],
resolve: {
extensions: ['.js', '.ts', '.tsx'],
@ -158,16 +162,19 @@ export const cli = merge({}, commonConfig, {
export const highlighter = merge({}, commonConfig, {
entry: { highlighter: path.resolve(__dirname, 'src/highlighter/index') },
output: {
libraryTarget: 'var',
library: {
name: '[name]',
type: 'var',
},
chunkFilename: 'highlighter/[name].js',
},
optimization: {
namedChunks: true,
chunkIds: 'named',
splitChunks: {
cacheGroups: {
modes: {
enforce: true,
name: (mod, chunks) => {
name: (mod: any) => {
const builtInMode = /node_modules[\\\/]codemirror[\\\/]mode[\\\/](\w+)[\\\/]/i.exec(
mod.resource
)

View file

@ -13,7 +13,7 @@ const cliConfig = merge({}, common.cli, config)
const highlighterConfig = merge({}, common.highlighter, config)
const getRendererEntryPoint = () => {
const entry = common.renderer.entry as webpack.Entry
const entry = common.renderer.entry as webpack.EntryObject
if (entry == null) {
throw new Error(
`Unable to resolve entry point. Check webpack.common.ts and try again`
@ -58,6 +58,9 @@ const rendererConfig = merge({}, common.renderer, config, {
},
],
},
infrastructureLogging: {
level: 'error',
},
plugins: [new webpack.HotModuleReplacementPlugin()],
})

View file

@ -67,7 +67,6 @@
"awesome-node-loader": "^1.1.0",
"azure-storage": "^2.10.4",
"chalk": "^2.2.0",
"clean-webpack-plugin": "^0.1.19",
"codecov": "^3.7.1",
"cross-env": "^5.0.5",
"css-loader": "^2.1.0",
@ -83,7 +82,7 @@
"front-matter": "^2.3.0",
"fs-extra": "^9.0.1",
"glob": "^7.1.2",
"html-webpack-plugin": "^3.2.0",
"html-webpack-plugin": "^5.5.0",
"jest": "^26.6.3",
"jest-diff": "^25.0.0",
"jest-extended": "^0.11.2",
@ -91,7 +90,7 @@
"jszip": "^3.7.1",
"klaw-sync": "^3.0.0",
"legal-eagle": "0.16.0",
"mini-css-extract-plugin": "^0.4.0",
"mini-css-extract-plugin": "^2.5.3",
"parallel-webpack": "^2.3.0",
"prettier": "2.0.5",
"request": "^2.72.0",
@ -104,40 +103,36 @@
"style-loader": "^0.21.0",
"to-camel-case": "^1.0.0",
"ts-jest": "^26.4.4",
"ts-loader": "^8",
"ts-loader": "^9",
"ts-node": "^7.0.0",
"typescript": "^4.5.5",
"webpack": "^4.8.3",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-dev-middleware": "^3.1.3",
"webpack-hot-middleware": "^2.22.2",
"webpack-merge": "^4.1.2",
"webpack": "^5.68.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-dev-middleware": "^5.3.1",
"webpack-hot-middleware": "^2.25.1",
"webpack-merge": "^5.8.0",
"xml2js": "^0.4.16"
},
"devDependencies": {
"@types/byline": "^4.2.31",
"@types/classnames": "^2.2.2",
"@types/clean-webpack-plugin": "^0.1.2",
"@types/codemirror": "5.60.4",
"@types/deep-equal": "^1.0.1",
"@types/dompurify": "^2.3.1",
"@types/double-ended-queue": "^2.1.0",
"@types/electron-winstaller": "^4.0.0",
"@types/eslint": "^7.2.13",
"@types/eslint": "^8.4.1",
"@types/estree": "^0.0.49",
"@types/event-kit": "^1.2.28",
"@types/express": "^4.11.0",
"@types/extract-text-webpack-plugin": "^3.0.3",
"@types/file-url": "^2.0.0",
"@types/fs-extra": "^7.0.0",
"@types/fuzzaldrin-plus": "^0.0.1",
"@types/glob": "^5.0.35",
"@types/html-webpack-plugin": "^2.30.3",
"@types/jest": "^23.3.1",
"@types/klaw-sync": "^6.0.0",
"@types/legal-eagle": "^0.15.0",
"@types/memoize-one": "^3.1.1",
"@types/mini-css-extract-plugin": "^0.2.0",
"@types/moment-duration-format": "^2.2.2",
"@types/mri": "^1.1.0",
"@types/node": "16.11.11",
@ -161,11 +156,10 @@
"@types/untildify": "^3.0.0",
"@types/username": "^3.0.0",
"@types/uuid": "^3.4.0",
"@types/webpack": "^4.4.0",
"@types/webpack-bundle-analyzer": "^2.9.2",
"@types/webpack-dev-middleware": "^2.0.1",
"@types/webpack-hot-middleware": "^2.16.3",
"@types/webpack-merge": "^4.1.3",
"@types/webpack": "^5.28.0",
"@types/webpack-bundle-analyzer": "^4.4.1",
"@types/webpack-hot-middleware": "^2.25.6",
"@types/webpack-merge": "^5.0.0",
"@types/xml2js": "^0.4.0",
"electron": "17.0.1",
"electron-builder": "^22.7.0",

View file

@ -52,7 +52,6 @@ if (process.env.NODE_ENV === 'production') {
message,
u(message, u(message, rendererConfig).output).publicPath
),
logLevel: 'error',
})
)

2318
yarn.lock

File diff suppressed because it is too large Load diff