11/*** DO NOT TOUCH ***/ 
2- import  {  DefaultConfig ,  DefaultLoaders  }  from  './webpack' 
3- import  {  root  }  from  './helpers' 
4- import  { 
5-  DefinePlugin 
6- }  from  'webpack' 
7- import  {  CheckerPlugin  }  from  'awesome-typescript-loader' 
8- import  {  TsConfigPathsPlugin  }  from  'awesome-typescript-loader' 
9- import  *  as  CopyWebpackPlugin  from  'copy-webpack-plugin' 
10- import  *  as  HtmlWebpackPlugin  from  'html-webpack-plugin' 
11- 
2+ import  {  DefaultConfig ,  DefaultLoaders  }  from  './webpack' ; 
3+ import  {  root  }  from  './helpers' ; 
4+ import  {  DefinePlugin  }  from  'webpack' ; 
5+ import  {  CheckerPlugin  }  from  'awesome-typescript-loader' ; 
6+ import  {  TsConfigPathsPlugin  }  from  'awesome-typescript-loader' ; 
7+ import  *  as  CopyWebpackPlugin  from  'copy-webpack-plugin' ; 
8+ import  *  as  HtmlWebpackPlugin  from  'html-webpack-plugin' ; 
129
1310// optimization 
14- import  *  as  BrotliPlugin  from  'brotli-webpack-plugin' 
15- import  *  as  CompressionPlugin  from  'compression-webpack-plugin' 
16- import  *  as  OptimizeJsPlugin  from  'optimize-js-plugin' 
17- import  *  as  MiniCssExtractPlugin  from  'mini-css-extract-plugin' 
11+ import  *  as  BrotliPlugin  from  'brotli-webpack-plugin' ; 
12+ import  *  as  CompressionPlugin  from  'compression-webpack-plugin' ; 
13+ import  *  as  OptimizeJsPlugin  from  'optimize-js-plugin' ; 
14+ import  *  as  MiniCssExtractPlugin  from  'mini-css-extract-plugin' ; 
1815
1916// postCss 
20- import  *  as  Autoprefixer  from  'autoprefixer' 
21- import  *  as  CssNano  from  'cssnano' 
17+ import  *  as  Autoprefixer  from  'autoprefixer' ; 
18+ import  *  as  CssNano  from  'cssnano' ; 
2219
2320// ssr 
24- import  *  as  VueSSRClientPlugin  from  'vue-server-renderer/client-plugin' 
25- import  *  as  VueSSRServerPlugin  from  'vue-server-renderer/server-plugin' 
26- import  {  NamedModulesPlugin  }  from  'webpack' 
21+ import  *  as  VueSSRClientPlugin  from  'vue-server-renderer/client-plugin' ; 
22+ import  *  as  VueSSRServerPlugin  from  'vue-server-renderer/server-plugin' ; 
23+ import  {  NamedModulesPlugin  }  from  'webpack' ; 
2724
28- import  {  CustomHeadTags ,  CustomCopyFolders  }  from  './custom' 
25+ import  {  CustomHeadTags ,  CustomCopyFolders  }  from  './custom' ; 
2926
3027// copy 
3128export  const  DefaultCopyFolders  =  [ 
3229 {  from : 'src/static' ,  ignore : [ 'favicon.ico' ]  } , 
3330 {  from : 'src/meta'  } 
34- ] 
31+ ] ; 
3532
3633export  const  loader : DefaultLoaders  =  { 
3734 tsLintLoader : { 
@@ -74,25 +71,26 @@ export const loader: DefaultLoaders = {
7471 } 
7572 ] 
7673 } , 
74+  fontLoader : { 
75+  test : / \. ( t t f | e o t | w o f f | w o f f 2 ) $ / , 
76+  use : { 
77+  loader : 'file-loader' , 
78+  options : { 
79+  name : 'fonts/[name].[ext]' 
80+  } 
81+  } 
82+  } , 
7783 cssLoader : { 
7884 test : / \. ( s a | s c | c ) s s $ / , 
7985 use : [ 
8086 MiniCssExtractPlugin . loader , 
8187 { 
82-  loader : 'css-loader' , 
83-  options : { 
84-  importLoader : 1 , 
85-  modules : true , 
86-  localIdentName : '[name]__[local]___[hash:base64:5]' 
87-  } 
88+  loader : 'css-loader' 
8889 } , 
8990 { 
9091 loader : 'postcss-loader' , 
9192 options : { 
92-  plugins : ( )  =>  [ 
93-  Autoprefixer ( ) , 
94-  CssNano ( ) 
95-  ] 
93+  plugins : ( )  =>  [ Autoprefixer ( ) ,  CssNano ( ) ] 
9694 } 
9795 } 
9896 ] 
@@ -106,23 +104,28 @@ export const loader: DefaultLoaders = {
106104 test : / \. ( j p g | p n g | g i f ) $ / , 
107105 use : 'file-loader' 
108106 } 
109- } 
107+ } ; 
110108
111109export  const  DefaultCommonConfig  =  ( {  isDev } ) : DefaultConfig  =>  { 
112110 return  { 
113-  rules : [ loader . cssLoader ,  loader . htmlLoader ,  loader . fileLoader ] , 
111+  rules : [ 
112+  loader . cssLoader , 
113+  loader . fontLoader , 
114+  loader . htmlLoader , 
115+  loader . fileLoader 
116+  ] , 
114117 plugins : [ 
115118 new  CheckerPlugin ( ) , 
116119 new  TsConfigPathsPlugin ( ) , 
117120 new  MiniCssExtractPlugin ( { 
118121 // Options similar to the same options in webpackOptions.output 
119122 // both options are optional 
120123 filename : isDev  ? '[name].css'  : '[name].[hash].css' , 
121-  chunkFilename : isDev  ? '[id].css'  : '[id].[hash].css' , 
122-  } ) , 
124+  chunkFilename : isDev  ? '[id].css'  : '[id].[hash].css' 
125+  } ) 
123126 ] 
124-  } 
125- } 
127+  } ; 
128+ } ; 
126129
127130export  const  DefaultDevConfig  =  ( {  isDev } ) : DefaultConfig  =>  { 
128131 return  { 
@@ -131,7 +134,9 @@ export const DefaultDevConfig = ({ isDev }): DefaultConfig => {
131134 new  DefinePlugin ( { 
132135 __DEV__ : isDev , 
133136 __PROD__ : ! isDev , 
134-  'process.env.NODE_ENV' : JSON . stringify ( process . env . NODE_ENV  ||  'development' ) , 
137+  'process.env.NODE_ENV' : JSON . stringify ( 
138+  process . env . NODE_ENV  ||  'development' 
139+  ) , 
135140 'process.env.VUE_ENV' : '"client"' 
136141 } ) , 
137142 new  HtmlWebpackPlugin ( { 
@@ -141,11 +146,11 @@ export const DefaultDevConfig = ({ isDev }): DefaultConfig => {
141146 } ) , 
142147 new  NamedModulesPlugin ( ) , 
143148 new  CopyWebpackPlugin ( [ ...DefaultCopyFolders ,  ...CustomCopyFolders ] ) , 
144-  new  VueSSRClientPlugin ( ) , 
149+  new  VueSSRClientPlugin ( ) 
145150 // ManifestPlugin 
146151 ] 
147-  } 
148- } 
152+  } ; 
153+ } ; 
149154
150155export  const  DefaultSsrConfig  =  ( {  isDev } ) : DefaultConfig  =>  { 
151156 return  { 
@@ -154,13 +159,15 @@ export const DefaultSsrConfig = ({ isDev }): DefaultConfig => {
154159 new  DefinePlugin ( { 
155160 __DEV__ : isDev , 
156161 __PROD__ : ! isDev , 
157-  'process.env.NODE_ENV' : JSON . stringify ( process . env . NODE_ENV  ||  'development' ) , 
162+  'process.env.NODE_ENV' : JSON . stringify ( 
163+  process . env . NODE_ENV  ||  'development' 
164+  ) , 
158165 'process.env.VUE_ENV' : '"server"' 
159166 } ) , 
160167 new  VueSSRServerPlugin ( ) 
161168 ] 
162-  } 
163- } 
169+  } ; 
170+ } ; 
164171
165172export  const  DefaultProdConfig  =  ( {  isDev } ) : DefaultConfig  =>  { 
166173 return  { 
@@ -170,7 +177,9 @@ export const DefaultProdConfig = ({ isDev }): DefaultConfig => {
170177 new  DefinePlugin ( { 
171178 __DEV__ : isDev , 
172179 __PROD__ : ! isDev , 
173-  'process.env.NODE_ENV' : JSON . stringify ( process . env . NODE_ENV  ||  'development' ) , 
180+  'process.env.NODE_ENV' : JSON . stringify ( 
181+  process . env . NODE_ENV  ||  'development' 
182+  ) , 
174183 'process.env.VUE_ENV' : '"client"' 
175184 } ) , 
176185 new  OptimizeJsPlugin ( { 
@@ -195,7 +204,7 @@ export const DefaultProdConfig = ({ isDev }): DefaultConfig => {
195204 title : CustomHeadTags . title , 
196205 inject : false , 
197206 minify : false 
198-  } ) , 
207+  } ) 
199208 // new ScriptExtHtmlWebpackPlugin({ 
200209 // sync: /polyfills|vendor/, 
201210 // defaultAttribute: 'async', 
@@ -214,5 +223,5 @@ export const DefaultProdConfig = ({ isDev }): DefaultConfig => {
214223 // } 
215224 // }) 
216225 ] 
217-  } 
218- } 
226+  } ; 
227+ } ; 
0 commit comments