From 10a17dc421fe9d9e7b0db24d39ae172c3d7da2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Wed, 6 Mar 2019 09:26:22 +0900 Subject: [PATCH] Bye on-build-webpack (#4404) * Update webpack.config.ts * Update package.json --- package.json | 1 - webpack.config.ts | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1cf1de95d..255b78492 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,6 @@ "nodemailer": "5.1.1", "nprogress": "0.2.0", "object-assign-deep": "0.4.0", - "on-build-webpack": "0.1.0", "os-utils": "0.0.14", "parse5": "5.1.0", "parsimmon": "1.12.0", diff --git a/webpack.config.ts b/webpack.config.ts index 4cf30b268..e1d7ad1af 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -6,11 +6,19 @@ import * as fs from 'fs'; import * as webpack from 'webpack'; import chalk from 'chalk'; const { VueLoaderPlugin } = require('vue-loader'); -const WebpackOnBuildPlugin = require('on-build-webpack'); //const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const ProgressBarPlugin = require('progress-bar-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); +class WebpackOnBuildPlugin { + constructor(readonly callback: (stats: any) => void) { + } + + public apply(compiler: any) { + compiler.hooks.done.tap('WebpackOnBuildPlugin', this.callback); + } +} + const isProduction = process.env.NODE_ENV == 'production'; const constants = require('./src/const.json');