refactor(client):

This commit is contained in:
syuilo 2020-04-22 19:36:28 +09:00
parent 51476ad06f
commit 6e3ee05cb6
7 changed files with 28 additions and 47 deletions

View file

@ -4,10 +4,7 @@
import * as fs from 'fs';
import * as webpack from 'webpack';
import * as chalk from 'chalk';
const { VueLoaderPlugin } = require('vue-loader');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
class WebpackOnBuildPlugin {
constructor(readonly callback: (stats: any) => void) {
@ -118,10 +115,7 @@ module.exports = {
}]
},
plugins: [
new ProgressBarPlugin({
format: chalk` {cyan.bold Yes we can} {bold [}:bar{bold ]} {green.bold :percent} {gray :elapseds}`,
clear: false
}),
new webpack.ProgressPlugin({}),
new webpack.DefinePlugin({
_VERSION_: JSON.stringify(meta.version),
_LANGS_: JSON.stringify(Object.entries(locales).map(([k, v]: [string, any]) => [k, v._lang_])),
@ -135,7 +129,6 @@ module.exports = {
output: {
path: __dirname + '/built/client/assets',
filename: `[name].${meta.version}.js`,
chunkFilename: '[fullhash].[id].js',
publicPath: `/assets/`
},
resolve: {
@ -149,13 +142,13 @@ module.exports = {
resolveLoader: {
modules: ['node_modules']
},
externals: {
moment: 'moment'
cache: {
type: 'filesystem',
buildDependencies: {
config: [__filename]
}
},
optimization: {
minimizer: [new TerserPlugin()]
},
cache: false,
devtool: false, //'source-map',
mode: isProduction ? 'production' : 'development'
};