File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const StyleLintPlugin = require('stylelint-webpack-plugin')
8
8
const SpriteLoaderPlugin = require ( 'svg-sprite-loader/plugin' )
9
9
const WebpackBar = require ( 'webpackbar' )
10
10
const DependencyExtractionWebpackPlugin = require ( '@wordpress/dependency-extraction-webpack-plugin' )
11
+ const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin
11
12
12
13
const browsersyncConfig = require ( './browsersync.config' )
13
14
@@ -35,6 +36,12 @@ module.exports = {
35
36
]
36
37
37
38
if ( mode === 'production' ) {
39
+ plugins . push (
40
+ new BundleAnalyzerPlugin ( {
41
+ analyzerMode : 'json' ,
42
+ generateStatsFile : true ,
43
+ } )
44
+ )
38
45
plugins . push (
39
46
new WebpackManifestPlugin ( {
40
47
fileName : 'assets.json' ,
Original file line number Diff line number Diff line change 12
12
"lint:css" : " node_modules/.bin/stylelint \" src/scss/**/*.scss\" " ,
13
13
"lint:js" : " node_modules/.bin/eslint \" src/js/**/*.js\" " ,
14
14
"lint" : " node_modules/.bin/concurrently \" yarn lint:css\" \" yarn lint:js\" " ,
15
- "bundle-report" : " yarn webpack --config config/webpack.prod.js --json=dist/stats.json && yarn webpack-bundle-analyzer dist/stats.json" ,
15
+ "bundle-report" : " yarn build && yarn webpack-bundle-analyzer dist/stats.json" ,
16
16
"image" : " yarn node config/image-sizes.js"
17
17
},
18
18
"license" : " GPL-2.0" ,
Original file line number Diff line number Diff line change 1
- import lazySizes from 'lazysizes'
2
- import 'lazysizes/plugins/native-loading/ls.native-loading'
3
- import 'lazysizes/plugins/object-fit/ls.object-fit'
1
+ import 'lazysizes'
4
2
import 'lazysizes/plugins/print/ls.print'
5
3
import './classes/ScrollDirection'
6
4
import './classes/ButtonSeoClick'
7
5
import './classes/Header'
8
6
import './classes/Animation'
9
-
10
- /**
11
- * LazySizes configuration
12
- * https://github.com/aFarkas/lazysizes/#js-api---options
13
- */
14
- lazySizes . cfg . nativeLoading = {
15
- setLoadingAttribute : false ,
16
- }
You can’t perform that action at this time.
0 commit comments