File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,4 +277,14 @@ exports.filter = {
277277 args : {
278278 exclude : / \[ m i n i - c s s - e x t r a c t - p l u g i n ] \n C o n f l i c t i n g o r d e r b e t w e e n : /
279279 }
280+ } ;
281+
282+ exports . vconsole = {
283+ enable : false ,
284+ type : 'client' ,
285+ name : 'vconsole-webpack-plugin' ,
286+ args ( ) {
287+ const enable = [ 'dev' , 'test' ] . indexOf ( this . env ) > - 1 ;
288+ return { enable } ;
289+ }
280290} ;
Original file line number Diff line number Diff line change 6060 "thread-loader" : " ^1.1.5" ,
6161 "uglifyjs-webpack-plugin" : " ^2.0.1" ,
6262 "url-loader" : " ^0.5.8" ,
63+ "vconsole-webpack-plugin" : " ^1.4.2" ,
6364 "webpack-asset-file-plugin" : " ^1.0.0" ,
6465 "webpack-filter-warnings-plugin" : " ^1.2.0" ,
6566 "webpack-hot-middleware" : " ^2.13.2" ,
Original file line number Diff line number Diff line change @@ -516,5 +516,30 @@ describe('client.test.js', () => {
516516 const webpackConfig = builder . create ( ) ;
517517 expect ( webpackConfig . externals . jquery ) . to . equal ( 'jquery' ) ;
518518 } ) ;
519+ it ( 'should vconsole webpack plugin dev test' , ( ) => {
520+ const builder = createBuilder ( {
521+ plugins :[
522+ {
523+ vconsole : true
524+ }
525+ ]
526+ } ) ;
527+ const webpackConfig = builder . create ( ) ;
528+ const vconsole = helper . getPluginByLabel ( 'vconsole' , webpackConfig . plugins ) ;
529+ expect ( vconsole . options . enable ) . to . be . true ;
530+ } ) ;
531+ it ( 'should vconsole webpack plugin prod test' , ( ) => {
532+ const builder = createBuilder ( {
533+ env : 'prod' ,
534+ plugins :[
535+ {
536+ vconsole : true
537+ }
538+ ]
539+ } ) ;
540+ const webpackConfig = builder . create ( ) ;
541+ const vconsole = helper . getPluginByLabel ( 'vconsole' , webpackConfig . plugins ) ;
542+ expect ( vconsole . options . enable ) . to . be . false ;
543+ } ) ;
519544 } ) ;
520545} ) ;
You can’t perform that action at this time.
0 commit comments