11var gulp = require ( 'gulp' ) ,
2- uglify = require ( 'gulp-uglify' ) ,
32 insert = require ( 'gulp-insert' ) ,
3+ uglify = require ( 'gulp-uglify' ) ,
44 webpack = require ( 'gulp-webpack' )
55;
66
77var packageName = 'react-datetime' ;
88var pack = require ( './package.json' ) ;
99
10- var getWPConfig = function ( filename ) {
10+ var getWPConfig = function ( filename ) {
1111 return {
1212 externals : {
1313 react : 'React' ,
@@ -22,28 +22,28 @@ var getWPConfig = function( filename ){
2222 } ;
2323} ;
2424
25- var cr = ( '/*\n%%name%% v%%version%%\n%%homepage%%\n%%license%%: https://github.com/arqex/' + packageName + '/raw/master/LICENSE\n*/\n' )
25+ var cr = ( '/*\n%%name%% v%%version%%\n%%homepage%%\n%%license%%: https://github.com/arqex/' + packageName + '/raw/master/LICENSE\n*/\n' )
2626 . replace ( '%%name%%' , pack . name )
2727 . replace ( '%%version%%' , pack . version )
2828 . replace ( '%%license%%' , pack . license )
2929 . replace ( '%%homepage%%' , pack . homepage )
3030;
3131
32- var handleError = function ( err ) {
33- console . log ( 'Error: ' , err ) ;
32+ var handleError = function ( err ) {
33+ console . error ( 'Error:' , err ) ;
3434} ;
3535
36- function wp ( config , minify ) {
37- var stream = gulp . src ( './Datetime.js' )
36+ function wp ( config , minify ) {
37+ var stream = gulp . src ( './Datetime.js' )
3838 . pipe ( webpack ( config ) )
3939 ;
4040
41- if ( minify ) {
41+ if ( minify ) {
4242 stream = stream . pipe ( uglify ( ) ) . on ( 'error' , handleError ) ;
4343 }
4444
4545 return stream . pipe ( insert . prepend ( cr ) )
46- . pipe ( gulp . dest ( 'dist/' ) )
46+ . pipe ( gulp . dest ( 'dist/' ) )
4747 ;
4848}
4949
0 commit comments