|
@@ -16,6 +16,7 @@ const utils = require( './utils' );
|
|
|
const rollup = require( 'rollup' ).rollup;
|
|
const rollup = require( 'rollup' ).rollup;
|
|
|
const rollupBabel = require( 'rollup-plugin-babel' );
|
|
const rollupBabel = require( 'rollup-plugin-babel' );
|
|
|
const mkdirp = require( 'mkdirp' );
|
|
const mkdirp = require( 'mkdirp' );
|
|
|
|
|
+const tools = require( '../../utils/tools' );
|
|
|
|
|
|
|
|
module.exports = ( config ) => {
|
|
module.exports = ( config ) => {
|
|
|
const args = utils.parseArguments();
|
|
const args = utils.parseArguments();
|
|
@@ -29,7 +30,7 @@ module.exports = ( config ) => {
|
|
|
* Removes all files from bundle directory.
|
|
* Removes all files from bundle directory.
|
|
|
*/
|
|
*/
|
|
|
clean() {
|
|
clean() {
|
|
|
- return utils.clean( bundleDir, '*.*' );
|
|
|
|
|
|
|
+ return tools.clean( bundleDir, '*.*' );
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -107,14 +108,14 @@ module.exports = ( config ) => {
|
|
|
} )
|
|
} )
|
|
|
.then( () => {
|
|
.then( () => {
|
|
|
// If everything went well then remove tmp directory.
|
|
// If everything went well then remove tmp directory.
|
|
|
- utils.clean( bundleTmpDir, path.join( '' ) );
|
|
|
|
|
|
|
+ tools.clean( bundleTmpDir, path.join( '' ) );
|
|
|
} )
|
|
} )
|
|
|
.catch( ( err ) => {
|
|
.catch( ( err ) => {
|
|
|
// If something went wrong then log error.
|
|
// If something went wrong then log error.
|
|
|
gutil.log( gutil.colors.red( err.stack ) );
|
|
gutil.log( gutil.colors.red( err.stack ) );
|
|
|
|
|
|
|
|
// And remove tmp directory.
|
|
// And remove tmp directory.
|
|
|
- utils.clean( bundleTmpDir, path.join( '' ) );
|
|
|
|
|
|
|
+ tools.clean( bundleTmpDir, path.join( '' ) );
|
|
|
|
|
|
|
|
throw new Error( 'Build error.' );
|
|
throw new Error( 'Build error.' );
|
|
|
} );
|
|
} );
|