Skip to content

Commit

Permalink
chore: add build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Apr 28, 2021
1 parent 0d2f57a commit 758a8bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions build/webpack.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');
const Components = require('../components.json');
const config = require('./config');
Expand Down Expand Up @@ -36,7 +37,12 @@ const webpackConfig = {
hints: false,
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
cache: true,
}),
],
},
module: {
rules: [
Expand All @@ -52,7 +58,7 @@ const webpackConfig = {
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
use: ['cache-loader', 'babel-loader?cacheDirectory=true'],
},
{
test: /\.ts$/,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"axios": "^0.19.2",
"babel-eslint": "^10.0.2",
"babel-plugin-component": "^1.1.1",
"cache-loader": "^4.1.0",
"chai": "^4.2.0",
"clipboard": "^2.0.1",
"conventional-changelog-cli": "^2.1.0",
Expand Down Expand Up @@ -80,7 +81,7 @@
"style-loader": "^2.0.0",
"svg-sprite-loader": "^4.1.6",
"svgo-loader": "^2.2.1",
"terser-webpack-plugin": "^1.2.4",
"terser-webpack-plugin": "^1.4.5",
"ts-loader": "^8.1.0",
"typescript": "~3.8.3",
"vue": "2.6.11",
Expand Down

0 comments on commit 758a8bd

Please sign in to comment.