Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update webpack-dev-server to 4.14.0 #147

Merged
merged 2 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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