From ad85ea0d3b991a2965998b703662df7d75451a9d Mon Sep 17 00:00:00 2001 From: bangbang93 Date: Fri, 13 Oct 2023 10:13:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/default/logger.js | 6 +--- package-lock.json | 63 +++++----------------------------------- package.json | 8 ++--- src/setup-dev-server.ts | 3 +- 4 files changed, 12 insertions(+), 68 deletions(-) diff --git a/config/default/logger.js b/config/default/logger.js index fafa1b5d..ed05ec54 100644 --- a/config/default/logger.js +++ b/config/default/logger.js @@ -3,15 +3,11 @@ */ 'use strict' /* eslint-disable @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires */ -const BunyanPrettyStream = require('bunyan-prettystream') - -const prettyStream = new BunyanPrettyStream() -prettyStream.pipe(process.stdout) const streams = [ { type: 'raw', - stream: prettyStream, + stream: process.stdout, }, { level: 'fatal', stream: process.stderr, diff --git a/package-lock.json b/package-lock.json index eb67d3f1..7b50baf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,9 @@ "umzug": "^3.2.1", "unplugin-element-plus": "^0.7.0", "validator": "^13.6.0", + "vue": "^3.2.45", + "vue-fetch": "^2.0.0", + "vue-router": "^4.1.6", "vuex": "^4.0.2", "webpack-node-externals": "^3.0.0" }, @@ -107,14 +110,12 @@ "@types/nodemailer": "^6.4.0", "@types/prismjs": "^1.26.0", "@types/serve-favicon": "^2.5.0", - "@types/webpack": "^5.28.0", "@types/webpack-node-externals": "^2.5.3", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "@vue/cli-plugin-babel": "^5.0.1", "@vue/cli-service": "^5.0.1", "babel-loader": "^8.1.0", - "bunyan-prettystream": "^0.1.3", "css-loader": "^3.4.2", "es6-promise": "^4.2.8", "eslint": "^8.27.0", @@ -133,10 +134,7 @@ "typescript": "^4.8.4", "url": "^0.11.0", "url-loader": "^4.0.0", - "vue": "^3.2.45", - "vue-fetch": "^2.0.0", "vue-loader": "^17.0.1", - "vue-router": "^4.1.6", "vue-style-loader": "^4.1.2", "webpack": "^5.76.0", "webpack-dev-middleware": "^6.0.1", @@ -5324,8 +5322,7 @@ "node_modules/@types/debug": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-0.0.30.tgz", - "integrity": "sha512-orGL5LXERPYsLov6CWs3Fh6203+dXzJkR7OnddIr2514Hsecwc8xRpzCapshBbKFImCsvS/mk6+FWiN5LyZJAQ==", - "dev": true + "integrity": "sha512-orGL5LXERPYsLov6CWs3Fh6203+dXzJkR7OnddIr2514Hsecwc8xRpzCapshBbKFImCsvS/mk6+FWiN5LyZJAQ==" }, "node_modules/@types/eslint": { "version": "8.4.10", @@ -5655,17 +5652,6 @@ "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog==" }, - "node_modules/@types/webpack": { - "version": "5.28.0", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz", - "integrity": "sha512-8cP0CzcxUiFuA9xGJkfeVpqmWTk9nx6CWwamRGCj95ph1SmlRRk9KlCZ6avhCbZd4L68LvYT6l1kpdEnQXrF8w==", - "dev": true, - "dependencies": { - "@types/node": "*", - "tapable": "^2.2.0", - "webpack": "^5" - } - }, "node_modules/@types/webpack-node-externals": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/@types/webpack-node-externals/-/webpack-node-externals-2.5.3.tgz", @@ -9130,15 +9116,6 @@ "safe-json-stringify": "~1" } }, - "node_modules/bunyan-prettystream": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/bunyan-prettystream/-/bunyan-prettystream-0.1.3.tgz", - "integrity": "sha512-ovZoJY65kWByTUEDu1gMB89t+NGV9Ixm7azEhp2zXiGfSTvPGlu8+HFiVp6XuEQw0P6OS0oyi/Za6gknsl8Bwg==", - "dev": true, - "engines": [ - "node >=0.8.0" - ] - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -24233,7 +24210,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/vue-fetch/-/vue-fetch-2.0.0.tgz", "integrity": "sha512-PMMGpGu+oW0Gf6jk/5vAUVnLXmtaiDYp65eralu6dVU4QNG4vT+Zv6Iidv3KcUTmuPn7TJRixRUJ9y4R4HSeyg==", - "dev": true, "dependencies": { "@types/debug": "0.0.30", "@types/node": "^9.4.6", @@ -24247,14 +24223,12 @@ "node_modules/vue-fetch/node_modules/@types/node": { "version": "9.6.61", "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.61.tgz", - "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==", - "dev": true + "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==" }, "node_modules/vue-fetch/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -24367,7 +24341,6 @@ "version": "4.1.6", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.6.tgz", "integrity": "sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==", - "dev": true, "dependencies": { "@vue/devtools-api": "^6.4.5" }, @@ -29663,8 +29636,7 @@ "@types/debug": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-0.0.30.tgz", - "integrity": "sha512-orGL5LXERPYsLov6CWs3Fh6203+dXzJkR7OnddIr2514Hsecwc8xRpzCapshBbKFImCsvS/mk6+FWiN5LyZJAQ==", - "dev": true + "integrity": "sha512-orGL5LXERPYsLov6CWs3Fh6203+dXzJkR7OnddIr2514Hsecwc8xRpzCapshBbKFImCsvS/mk6+FWiN5LyZJAQ==" }, "@types/eslint": { "version": "8.4.10", @@ -29992,17 +29964,6 @@ "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.0.tgz", "integrity": "sha512-xTE1E+YF4aWPJJeUzaZI5DRntlkY3+BCVJi0axFptnjGmAoWxkyREIh/XMrfxVLejwQxMCfDXdICo0VLxThrog==" }, - "@types/webpack": { - "version": "5.28.0", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz", - "integrity": "sha512-8cP0CzcxUiFuA9xGJkfeVpqmWTk9nx6CWwamRGCj95ph1SmlRRk9KlCZ6avhCbZd4L68LvYT6l1kpdEnQXrF8w==", - "dev": true, - "requires": { - "@types/node": "*", - "tapable": "^2.2.0", - "webpack": "^5" - } - }, "@types/webpack-node-externals": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/@types/webpack-node-externals/-/webpack-node-externals-2.5.3.tgz", @@ -32543,12 +32504,6 @@ "safe-json-stringify": "~1" } }, - "bunyan-prettystream": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/bunyan-prettystream/-/bunyan-prettystream-0.1.3.tgz", - "integrity": "sha512-ovZoJY65kWByTUEDu1gMB89t+NGV9Ixm7azEhp2zXiGfSTvPGlu8+HFiVp6XuEQw0P6OS0oyi/Za6gknsl8Bwg==", - "dev": true - }, "bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -43861,7 +43816,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/vue-fetch/-/vue-fetch-2.0.0.tgz", "integrity": "sha512-PMMGpGu+oW0Gf6jk/5vAUVnLXmtaiDYp65eralu6dVU4QNG4vT+Zv6Iidv3KcUTmuPn7TJRixRUJ9y4R4HSeyg==", - "dev": true, "requires": { "@types/debug": "0.0.30", "@types/node": "^9.4.6", @@ -43872,14 +43826,12 @@ "@types/node": { "version": "9.6.61", "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.61.tgz", - "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==", - "dev": true + "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==" }, "debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "requires": { "ms": "^2.1.1" } @@ -43964,7 +43916,6 @@ "version": "4.1.6", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.6.tgz", "integrity": "sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ==", - "dev": true, "requires": { "@vue/devtools-api": "^6.4.5" } diff --git a/package.json b/package.json index 450234b2..c04e3de8 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,9 @@ "umzug": "^3.2.1", "unplugin-element-plus": "^0.7.0", "validator": "^13.6.0", + "vue": "^3.2.45", + "vue-fetch": "^2.0.0", + "vue-router": "^4.1.6", "vuex": "^4.0.2", "webpack-node-externals": "^3.0.0" }, @@ -118,14 +121,12 @@ "@types/nodemailer": "^6.4.0", "@types/prismjs": "^1.26.0", "@types/serve-favicon": "^2.5.0", - "@types/webpack": "^5.28.0", "@types/webpack-node-externals": "^2.5.3", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "@vue/cli-plugin-babel": "^5.0.1", "@vue/cli-service": "^5.0.1", "babel-loader": "^8.1.0", - "bunyan-prettystream": "^0.1.3", "css-loader": "^3.4.2", "es6-promise": "^4.2.8", "eslint": "^8.27.0", @@ -144,10 +145,7 @@ "typescript": "^4.8.4", "url": "^0.11.0", "url-loader": "^4.0.0", - "vue": "^3.2.45", - "vue-fetch": "^2.0.0", "vue-loader": "^17.0.1", - "vue-router": "^4.1.6", "vue-style-loader": "^4.1.2", "webpack": "^5.76.0", "webpack-dev-middleware": "^6.0.1", diff --git a/src/setup-dev-server.ts b/src/setup-dev-server.ts index 52ccee20..47691bd5 100644 --- a/src/setup-dev-server.ts +++ b/src/setup-dev-server.ts @@ -1,11 +1,10 @@ import {Application} from 'express' import {join} from 'path' import {App} from 'vue' -import webpack from 'webpack' - export async function setupDevServer(app: Application): Promise<(args: unknown) => Promise> { const wdm = require('webpack-dev-middleware') + const webpack: typeof import('webpack') = require('webpack') const [clientConfig, adminConfig, serverConfig] = await Promise.all([ import('./webpack/webpack.conf').then((m) => m.default), import('./webpack/webpack.admin').then((m) => m.default),