@@ -8,10 +8,9 @@ module.exports = function(S) {
8
8
9
9
const path = require ( 'path' ) ,
10
10
_ = require ( 'lodash' ) ,
11
- fs = require ( 'fs' ) ,
11
+ fs = require ( 'fs-extra ' ) ,
12
12
browserify = require ( 'browserify' ) ,
13
13
UglifyJS = require ( 'uglify-js' ) ,
14
- wrench = require ( 'wrench' ) ,
15
14
BbPromise = require ( 'bluebird' ) ;
16
15
17
16
/**
@@ -270,16 +269,11 @@ module.exports = function(S) {
270
269
let destPath = path . join ( _this . optimizedDistPath , p ) ;
271
270
272
271
if ( fs . lstatSync ( p ) . isDirectory ( ) ) {
273
- wrench . mkdirSyncRecursive ( destPath , '0777' ) ;
274
- wrench . copyDirSyncRecursive (
275
- path . join ( _this . evt . options . pathDist , p ) ,
276
- destPath , {
277
- forceDelete : true
278
- }
279
- ) ;
272
+ fs . mkdirsSync ( destPath , '0777' ) ;
273
+ fs . copySync ( path . join ( _this . evt . options . pathDist , p ) , destPath , { clobber : true , dereference : true } ) ;
280
274
} else {
281
- wrench . mkdirSyncRecursive ( path . dirname ( destPath ) , '0777' ) ;
282
- S . utils . writeFileSync ( destPath , S . utils . readFileSync ( p ) ) ;
275
+ fs . mkdirsSync ( path . dirname ( destPath ) , '0777' ) ;
276
+ fs . copySync ( p , destPath , { clobber : true , dereference : true } ) ;
283
277
}
284
278
} ) ;
285
279
}
0 commit comments