From 59407fc0c4ae46431dcf612e621f1e54caaf51a2 Mon Sep 17 00:00:00 2001 From: Tony Air Date: Tue, 25 Feb 2020 13:22:43 +0700 Subject: [PATCH] webpack speed improvements --- package.json | 4 +++- webpack.config.js | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4c32452..49afc8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate", - "version": "1.8.1", + "version": "1.8.2", "author": "Tony Air ", "license": "MIT", "description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.", @@ -85,6 +85,7 @@ "extract-text-webpack-plugin": "^4.0.0-beta.0", "favicons-webpack-plugin": "^1.0.2", "file-loader": "^1.1.5", + "hard-source-webpack-plugin": "^0.13.1", "html-loader": "^0.5.5", "html-webpack-plugin": "^4.0.0-beta.11", "imagemin-gifsicle": "^7.0.0", @@ -92,6 +93,7 @@ "imagemin-optipng": "^7.1.0", "imagemin-svgo": "^7.0.0", "imagemin-webpack": "^5.1.1", + "loglevel": "^1.6.7", "lost": "^8.3.1", "material-design-color": "^2.3.2", "node-sass": "^4.13.1", diff --git a/webpack.config.js b/webpack.config.js index 6412e79..b60f47a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,6 +7,8 @@ const path = require('path'); const filesystem = require('fs'); const autoprefixer = require('autoprefixer'); + +const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); @@ -20,6 +22,7 @@ const plugins = [ NODE_ENV: JSON.stringify('production'), }, }), + new HardSourceWebpackPlugin(), new webpack.LoaderOptionsPlugin({ minimize: COMPRESS, debug: false, @@ -240,10 +243,12 @@ module.exports = { ['@babel/transform-react-jsx'], ['react-hot-loader/babel'], ], + cacheDirectory: true, + cacheCompression: false, }, }, }, - { + /*{ test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/, @@ -251,7 +256,7 @@ module.exports = { { test: /\.coffee?$/, use: 'coffee-loader', - }, + },*/ { test: /\.worker\.js$/, use: {