Update extension to webpack v5.40.0

pull/285/head
Kelvin Schoofs 3 years ago
parent d167ac83a6
commit f62bfa669d

@ -352,9 +352,8 @@
"scripts": { "scripts": {
"vscode:prepublish": "yarn run build && cd webview && yarn run build", "vscode:prepublish": "yarn run build && cd webview && yarn run build",
"build": "webpack --mode production", "build": "webpack --mode production",
"compile": "webpack --mode none --info-verbosity verbose --display-modules", "compile": "webpack --mode development",
"profile": "webpack --mode production --profile --json > stats.json", "watch": "webpack --mode development --watch"
"watch": "webpack --mode none --watch --info-verbosity verbose --display-modules"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^12.7.12", "@types/node": "^12.7.12",
@ -363,13 +362,13 @@
"@types/vscode": "~1.49.0", "@types/vscode": "~1.49.0",
"@types/webpack": "^4.4.25", "@types/webpack": "^4.4.25",
"@types/winreg": "^1.2.30", "@types/winreg": "^1.2.30",
"clean-webpack-plugin": "^2.0.0", "clean-webpack-plugin": "^4.0.0-alpha.0",
"source-map": "^0.7.3", "source-map": "^0.7.3",
"source-map-support": "^0.5.19", "source-map-support": "^0.5.19",
"ts-loader": "^7.0.5", "ts-loader": "^9.2.3",
"typescript": "^4.3.4", "typescript": "^4.3.4",
"webpack": "^4.29.6", "webpack": "^5.40.0",
"webpack-cli": "^3.2.3" "webpack-cli": "^4.7.2"
}, },
"dependencies": { "dependencies": {
"event-stream": "^4.0.1", "event-stream": "^4.0.1",

@ -5,7 +5,7 @@
const { join, resolve, dirname } = require('path'); const { join, resolve, dirname } = require('path');
const fs = require('fs'); const fs = require('fs');
const webpack = require('webpack'); const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin').default; const { CleanWebpackPlugin } = require('clean-webpack-plugin');
/** /**
* @template T * @template T
@ -46,6 +46,7 @@ class CopyPuttyExecutable {
/**@type {webpack.Configuration}*/ /**@type {webpack.Configuration}*/
const config = { const config = {
mode: 'development',
target: 'node', target: 'node',
node: false, node: false,
entry: './src/extension.ts', entry: './src/extension.ts',
@ -80,6 +81,28 @@ const config = {
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
new CopyPuttyExecutable(), new CopyPuttyExecutable(),
], ],
optimization: {
splitChunks: {
minSize: 0,
cacheGroups: {
default: false,
defaultVendors: false,
},
},
},
stats: {
ids: true,
assets: false,
chunks: false,
entrypoints: true,
modules: true,
groupModulesByPath: true,
modulesSpace: 50,
excludeModules(name, { issuerPath }) {
if (name.startsWith('external ')) return true;
return issuerPath && issuerPath[issuerPath.length - 1].name.startsWith('./node_modules');
},
},
} }
module.exports = config; module.exports = config;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save