File tree Expand file tree Collapse file tree 2 files changed +27
-16
lines changed
Expand file tree Collapse file tree 2 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -116,22 +116,27 @@ const internalFs = {
116116 return new Promise ( ( resolve , reject ) => {
117117 console . log ( "Deleting " + filename ) ;
118118
119- Filesystem . stat ( { path : filename } )
120- . then ( ( stats ) => {
121- if ( stats . type === "directory" ) {
122- return Filesystem . rmdir ( { path : filename , recursive : true } ) ;
123- } else {
124- return Filesystem . deleteFile ( { path : filename } ) ;
125- }
126- } )
127- . then ( ( ) => {
128- console . log ( "Deleted successfully!" ) ;
129- resolve ( ) ;
130- } )
131- . catch ( ( error ) => {
132- console . error ( "Error while deleting:" , error ) ;
133- reject ( error ) ;
134- } ) ;
119+ if ( ! this . exists ( filename ) ) {
120+ console . log ( `File ${ filename } doesnt exists` ) ;
121+ resolve ( ) ;
122+ } else {
123+ Filesystem . stat ( { path : filename } )
124+ . then ( ( stats ) => {
125+ if ( stats . type === "directory" ) {
126+ return Filesystem . rmdir ( { path : filename , recursive : true } ) ;
127+ } else {
128+ return Filesystem . deleteFile ( { path : filename } ) ;
129+ }
130+ } )
131+ . then ( ( ) => {
132+ console . log ( "Deleted successfully!" ) ;
133+ resolve ( ) ;
134+ } )
135+ . catch ( ( error ) => {
136+ console . error ( "Error while deleting:" , error ) ;
137+ reject ( error ) ;
138+ } ) ;
139+ }
135140 } ) ;
136141 } ,
137142
Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ module.exports = (env, options) => {
8585 filename : '../../css/build/[name].css' ,
8686 } ) ,
8787 ] ,
88+ optimization : {
89+ minimize : mode === 'production' ,
90+ // Only set a custom minimizer in production; otherwise, omit it.
91+ ...( mode === 'production' ? { } : { minimizer : [ ] } ) ,
92+ } ,
93+
8894 } ;
8995
9096 return [ main ] ;
You can’t perform that action at this time.
0 commit comments