File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,8 @@ function nuxtPurgeCss (moduleOptions) {
40
40
config . paths = glob . sync ( config . paths . map ( p => path . join ( srcDir , p ) ) )
41
41
42
42
if ( ! enabled ) {
43
- if ( typeof purgeCSS . enabled === 'undefined' ) {
44
- logger . info ( 'PurgeCSS is not enabled because you are in dev mode' )
45
- return
46
- }
47
- logger . warn ( 'Module is not enabled' )
43
+ const msg = this . options . dev ? 'PurgeCSS is not enabled because you are in dev mode' : 'Module is not enabled'
44
+ logger . info ( msg )
48
45
return
49
46
}
50
47
@@ -58,7 +55,7 @@ function nuxtPurgeCss (moduleOptions) {
58
55
logger . error ( 'Webpack mode only works with build.extractCSS set to *true*. Either extract your CSS or use \'postcss\' mode' )
59
56
return
60
57
}
61
- this . extendBuild ( webpackFn ( enabled , config ) )
58
+ this . extendBuild ( webpackFn ( config ) )
62
59
return
63
60
}
64
61
@@ -92,10 +89,7 @@ function nuxtPurgeCss (moduleOptions) {
92
89
logger . success ( 'Module initialized in postcss mode' )
93
90
}
94
91
95
- const webpackFn = ( enabled , purgeCssConfig ) => ( config , ctx ) => {
96
- if ( typeof enabled === 'function' && ! enabled ( ctx ) ) {
97
- return
98
- }
92
+ const webpackFn = purgeCssConfig => ( config ) => {
99
93
const PurgeCssPlugin = require ( 'purgecss-webpack-plugin' )
100
94
config . plugins . push ( new PurgeCssPlugin ( purgeCssConfig ) )
101
95
logger . success ( 'Module initialized in webpack mode' )
You can’t perform that action at this time.
0 commit comments