forked from external-repos/squoosh
Lint webpack config, and only preload initial chunks
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const CleanPlugin = require('clean-webpack-plugin');
|
||||
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
@@ -129,9 +129,10 @@ module.exports = function(_, env) {
|
||||
// Remove old files before outputting a production build:
|
||||
isProd && new CleanPlugin([
|
||||
'assets',
|
||||
'**/*.{css,js,json,html}'
|
||||
'**/*.{css,js,json,html,map}'
|
||||
], {
|
||||
root: path.join(__dirname, 'build'),
|
||||
verbose: false,
|
||||
beforeEmit: true
|
||||
}),
|
||||
|
||||
@@ -181,7 +182,9 @@ module.exports = function(_, env) {
|
||||
}),
|
||||
|
||||
// Inject <link rel="preload"> for resources
|
||||
isProd && new PreloadWebpackPlugin(),
|
||||
isProd && new PreloadPlugin({
|
||||
include: 'initial'
|
||||
}),
|
||||
|
||||
isProd && new CrittersPlugin({
|
||||
// Don't inline fonts into critical CSS, but do preload them:
|
||||
|
||||
Reference in New Issue
Block a user