
const gulp    = require( 'gulp' )
const util    = require( 'gulp-util' )
const concat  = require( 'gulp-concat-util' )
const server  = require( 'gulp-connect' ).server
const webpack = require( 'webpack' )

// Unified tasks
gulp.task( 'default', [ 'index.js' ])
gulp.task( 'dev',     [ 'default', 'server', 'watch' ])

gulp.task( 'server', function() {
  server({ port: 3333 })
})

gulp.task( 'watch', function() {
  gulp.watch( './src/**/*.js', [ 'index.js' ])
})

gulp.task( 'index.js', [ 'pack' ], function() {
  gulp.src( './index.js' )
    .pipe(concat( 'index.js', {
      process: function( src ) {
        return src.replace( /IMPORT/g, 'require' )
      }
    }))
    .pipe(gulp.dest( './' ))
})

gulp.task( 'pack', function( callback ) {
  webpack({
    entry: './src/index.js',
    output: {
      path: __dirname,
      filename: 'index.js'
    },
    module: {
      loaders: [{
        test: /\.jsx?$/,
        exclude: /(node_modules)/,
        loader: 'babel'
      }]
    }
  }, function( error, stat ) {
    if ( error )  throw new util.PluginError( 'webpack', error )
    util.log( '[webpack]', stat.toString())
    callback()
  })
})


@@ -200,16 +200,61 @@
 ack' )%0A%0A
+const pkg     = require( './package.json' )%0A%0A
 // Unifi
@@ -579,18 +579,16 @@
 x.js' )%0A
-  
   .pipe(
@@ -613,18 +613,16 @@
 , %7B%0A    
-  
 process:
@@ -650,20 +650,37 @@
     
- 
- 
 return 
-src
+(%0A        src%0A        
 .rep
@@ -718,20 +718,67 @@
     
-%7D%0A    %7D)
+  .replace( /@VERSION/g, pkg.version )%0A      
 )%0A  
+ 
+ %7D%0A  %7D))%0A
   .p

Add version prop