Implemented some caching on the webpack compiler.

This commit is contained in:
2018-11-27 06:20:18 +11:00
parent c541380ecf
commit fe7d1054f7

View File

@ -27,7 +27,7 @@ const
webpack = require('webpack'), webpack = require('webpack'),
JimpLoader = require('responsive-loader/jimp'), JimpLoader = require('responsive-loader/jimp'),
//SharpLoader = require('responsive-loader/sharp'), SharpLoader = require('responsive-loader/sharp'),
HtmlWebpackPlugin = require('html-webpack-plugin'), HtmlWebpackPlugin = require('html-webpack-plugin'),
TerserPlugin = require('terser-webpack-plugin'), TerserPlugin = require('terser-webpack-plugin'),
MiniCssExtractPlugin = require("mini-css-extract-plugin"), MiniCssExtractPlugin = require("mini-css-extract-plugin"),
@ -67,7 +67,7 @@ module.exports = (isDev) => {
test: /\.jsx?$/, test: /\.jsx?$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: {
loader: 'babel-loader', loader: 'babel-loader?cacheDirectory',
options: { options: {
presets: [ presets: [
[ [
@ -154,7 +154,9 @@ module.exports = (isDev) => {
}; };
} else { } else {
let TerserPluginConfig = new TerserPlugin({ let TerserPluginConfig = new TerserPlugin({
test: /\.js($|\?)/i test: /\.js($|\?)/i,
cache: true,
parallel: true,
}); });
let MiniCssExtractConfig = new MiniCssExtractPlugin({ let MiniCssExtractConfig = new MiniCssExtractPlugin({