Merge pull request #26216 from vector-im/johannes/webpack-cli-4.10.0
This commit is contained in:
commit
de2d3ff204
3 changed files with 418 additions and 610 deletions
12
package.json
12
package.json
|
@ -41,14 +41,14 @@
|
||||||
"build:res": "ts-node scripts/copy-res.ts",
|
"build:res": "ts-node scripts/copy-res.ts",
|
||||||
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
|
"build:genfiles": "yarn build:res && yarn build:jitsi && yarn build:module_system",
|
||||||
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
|
"build:modernizr": "modernizr -c .modernizr.json -d src/vector/modernizr.js",
|
||||||
"build:bundle": "webpack --progress --bail --mode production",
|
"build:bundle": "webpack --progress --mode production",
|
||||||
"build:bundle-stats": "webpack --progress --bail --mode production --json > webpack-stats.json",
|
"build:bundle-stats": "webpack --progress --mode production --json > webpack-stats.json",
|
||||||
"build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
|
"build:module_system": "tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js",
|
||||||
"dist": "scripts/package.sh",
|
"dist": "scripts/package.sh",
|
||||||
"start": "yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
|
"start": "yarn build:module_system && concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js\"",
|
||||||
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
|
"start:https": "concurrently --kill-others-on-fail --prefix \"{time} [{name}]\" -n res,element-js \"yarn start:res\" \"yarn start:js --https\"",
|
||||||
"start:res": "yarn build:jitsi && ts-node scripts/copy-res.ts -w",
|
"start:res": "yarn build:jitsi && ts-node scripts/copy-res.ts -w",
|
||||||
"start:js": "webpack-dev-server --output-filename=bundles/_dev_/[name].js --output-chunk-filename=bundles/_dev_/[name].js -w --mode development --disable-host-check --hot",
|
"start:js": "webpack serve --output-path webapp --mode development",
|
||||||
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
|
"lint": "yarn lint:types && yarn lint:js && yarn lint:style",
|
||||||
"lint:js": "yarn lint:js:src && yarn lint:js:module_system",
|
"lint:js": "yarn lint:js:src && yarn lint:js:module_system",
|
||||||
"lint:js:src": "eslint --max-warnings 0 src test && prettier --check .",
|
"lint:js:src": "eslint --max-warnings 0 src test && prettier --check .",
|
||||||
|
@ -180,10 +180,10 @@
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"ts-prune": "^0.10.3",
|
"ts-prune": "^0.10.3",
|
||||||
"typescript": "5.2.2",
|
"typescript": "5.2.2",
|
||||||
"webpack": "^4.46.0",
|
"webpack": "^4.47.0",
|
||||||
"webpack-bundle-analyzer": "^4.8.0",
|
"webpack-bundle-analyzer": "^4.8.0",
|
||||||
"webpack-cli": "^3.3.12",
|
"webpack-cli": "^4.10.0",
|
||||||
"webpack-dev-server": "^3.11.2",
|
"webpack-dev-server": "^4.15.1",
|
||||||
"worker-loader": "^3.0.0",
|
"worker-loader": "^3.0.0",
|
||||||
"worklet-loader": "^2.0.0",
|
"worklet-loader": "^2.0.0",
|
||||||
"yaml": "^2.0.1"
|
"yaml": "^2.0.1"
|
||||||
|
|
|
@ -143,6 +143,9 @@ module.exports = (env, argv) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...development,
|
...development,
|
||||||
|
|
||||||
|
bail: true,
|
||||||
|
|
||||||
node: {
|
node: {
|
||||||
// Mock out the NodeFS module: The opus decoder imports this wrongly.
|
// Mock out the NodeFS module: The opus decoder imports this wrongly.
|
||||||
fs: "empty",
|
fs: "empty",
|
||||||
|
@ -725,14 +728,23 @@ module.exports = (env, argv) => {
|
||||||
|
|
||||||
// configuration for the webpack-dev-server
|
// configuration for the webpack-dev-server
|
||||||
devServer: {
|
devServer: {
|
||||||
// serve unwebpacked assets from webapp.
|
static: {
|
||||||
contentBase: ["./webapp"],
|
// Where to serve static assets from
|
||||||
|
directory: "./webapp",
|
||||||
|
},
|
||||||
|
|
||||||
// Only output errors, warnings, or new compilations.
|
devMiddleware: {
|
||||||
// This hides the massive list of modules.
|
// Only output errors, warnings, or new compilations.
|
||||||
stats: "minimal",
|
// This hides the massive list of modules.
|
||||||
hotOnly: true,
|
stats: "minimal",
|
||||||
inline: true,
|
},
|
||||||
|
|
||||||
|
// Enable Hot Module Replacement without page refresh as a fallback in
|
||||||
|
// case of build failures
|
||||||
|
hot: "only",
|
||||||
|
|
||||||
|
// Disable host check
|
||||||
|
allowedHosts: "all",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue