@@ -3,6 +3,7 @@ const distDir = __dirname + '/dist/four-point-eight';
33const fs = require ( 'fs' ) ;
44const { CleanWebpackPlugin } = require ( 'clean-webpack-plugin' ) ;
55const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
6+ const ManifestVersionSyncPlugin = require ( 'webpack-manifest-version-sync-plugin' ) ;
67const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
78const StyleLintPlugin = require ( 'stylelint-webpack-plugin' ) ;
89
@@ -20,27 +21,38 @@ module.exports = {
2021 test : / \. ( s c s s ) $ / ,
2122 use : [
2223 MiniCssExtractPlugin . loader ,
23- // Translates CSS into CommonJS modules.
24- { loader : 'css-loader' , options : { importLoaders : 2 } } ,
25- // Run postCSS actions.
26- { loader : 'postcss-loader' , options : { plugins : [ require ( 'autoprefixer' ) ] } } ,
27- // Compiles Sass to CSS.
24+ {
25+ loader : 'css-loader' ,
26+ options : {
27+ importLoaders : 2 ,
28+ } ,
29+ } ,
30+ {
31+ loader : 'postcss-loader' ,
32+ options : {
33+ plugins : [ require ( 'autoprefixer' ) ] ,
34+ } ,
35+ } ,
2836 {
2937 loader : 'sass-loader' ,
3038 options : {
3139 implementation : require ( 'sass' ) ,
3240 sassOptions : {
33- outputStyle : 'expanded'
34- }
35- }
36- }
41+ outputStyle : 'expanded' ,
42+ } ,
43+ } ,
44+ } ,
3745 ]
3846 } ,
3947 {
40- test : / \. w o f f 2 ? $ | \. t t f $ | \. e o t $ | \. s v g $ | \. p n g | \. j p e ? g | \. g i f $ / ,
41- loader : 'file-loader'
48+ test : / \. ( w o f f ( 2 ) ? | s v g ) $ / ,
49+ type : 'asset/inline' ,
4250 } ,
43- ]
51+ {
52+ test : / \. (?: i c o | g i f | j p e ? g | p n g | s v g | w e b p ) $ / i,
53+ type : 'asset/resource' ,
54+ } ,
55+ ] ,
4456 } ,
4557 plugins : [
4658 new CleanWebpackPlugin ( ) ,
@@ -55,6 +67,9 @@ module.exports = {
5567 new MiniCssExtractPlugin ( {
5668 filename : '[name]'
5769 } ) ,
70+ new ManifestVersionSyncPlugin ( {
71+ manifestPath : 'manifest.json' ,
72+ } ) ,
5873 new CopyWebpackPlugin ( {
5974 patterns : [
6075 {
@@ -63,5 +78,5 @@ module.exports = {
6378 } ,
6479 ] ,
6580 } ) ,
66- ]
81+ ] ,
6782} ;
0 commit comments