Skip to content

Commit

Permalink
chore: update webpack-dev-server to 4.14.0 (#147)
Browse files Browse the repository at this point in the history
* chore: update webpack-dev-server to 4.14.0

* docs(changeset): update webpack-dev-server to v4.14.0

---------

Co-authored-by: jialan <jialan@dtstack.com>
  • Loading branch information
JackWang032 and jialan committed Jun 20, 2023
1 parent 70ac1f4 commit e76ee46
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 156 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-jars-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ko': patch
---

update webpack-dev-server to v4.14.0
3 changes: 1 addition & 2 deletions packages/ko/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"css-minimizer-webpack-plugin": "^4.0.0",
"detect-port": "^1.3.0",
"dynamic-resolve-webpack-plugin": "workspace:^2.0.0",
"error-overlay-webpack-plugin": "^1.1.1",
"esbuild-loader": "^2.19.0",
"html-webpack-plugin": "^5.5.0",
"inquirer": "^8.2.2",
Expand All @@ -85,7 +84,7 @@
"thread-loader": "^3.0.4",
"webpack": "^5.72.1",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-dev-server": "4.9.0",
"webpack-dev-server": "4.14.0",
"webpackbar": "^5.0.2",
"worker-loader": "^3.0.8"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/ko/src/actions/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class Dev extends ActionFactory {
setupExitSignals: false,
allowedHosts: 'all',
client: {
overlay: false,
overlay: {
errors: true,
warnings: false,
runtimeErrors: true,
},
},
historyApiFallback,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs/promises';
import path from 'path';

class PurgeCacheWebpackPlugin {
WEBPACK_PULGIN_NAME = 'PurgeCacheWebpackPlugin';
WEBPACK_PLUGIN_NAME = 'PurgeCacheWebpackPlugin';

purgeCacheFiles(
directory: string,
Expand Down Expand Up @@ -50,12 +50,12 @@ class PurgeCacheWebpackPlugin {

apply(compiler: Compiler) {
compiler.hooks.done.tapAsync(
{ name: this.WEBPACK_PULGIN_NAME },
{ name: this.WEBPACK_PLUGIN_NAME },
(_, callback) => {
const { type, maxAge, cacheLocation } = compiler.options.cache as any;
if (type === 'filesystem') {
const logger = compiler.getInfrastructureLogger(
this.WEBPACK_PULGIN_NAME
this.WEBPACK_PLUGIN_NAME
);
this.purgeCacheFiles(cacheLocation, maxAge, errors => {
if (errors?.length) {
Expand Down
2 changes: 0 additions & 2 deletions packages/ko/src/webpack/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import AutoPolyfillsWebpackPlugin from 'auto-polyfills-webpack-plugin';
import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
import PurgeCacheWebpackPlugin from './custom-plugins/purge-cache-webpack-plugin';
import ErrorOverlayPlugin from 'error-overlay-webpack-plugin';
import { IWebpackOptions } from '../types';

function getPlugins(opts: IWebpackOptions) {
Expand Down Expand Up @@ -96,7 +95,6 @@ function getPlugins(opts: IWebpackOptions) {
},
}),
!isProd && new PurgeCacheWebpackPlugin(),
!isProd && new ErrorOverlayPlugin(),
isProd &&
autoPolyfills &&
(typeof autoPolyfills === 'boolean'
Expand Down

0 comments on commit e76ee46

Please sign in to comment.