@task(aliases=['pack'])
def webpack(ctx, clean=False, watch=False, dev=False):
 if clean:
  clean_assets(ctx)
 if (os.getcwd() != HERE):
  os.chdir(HERE)
 webpack_bin = os.path.join(HERE, 'node_modules', 'webpack', 'bin', 'webpack.js')
 args = [webpack_bin]
 if (settings.DEBUG_MODE and dev):
  args += ['--colors']
 else:
  args += ['--progress']
 if watch:
  args += ['--watch']
 config_file = ('webpack.admin.config.js' if dev else 'webpack.prod.config.js')
 args += ['--config {0}'.format(config_file)]
 command = ' '.join(args)
 ctx.run(command, echo=True)

@ task ( aliases = [ 'pack' ] ) def webpack ( ctx , clean = False , watch = False , dev = False ) : if clean : clean_assets ( ctx ) if ( os . getcwd ( ) != HERE ) : os . chdir ( HERE ) webpack_bin = os . path . join ( HERE , 'node_modules' , 'webpack' , 'bin' , 'webpack.js' ) args = [ webpack_bin ] if ( settings . DEBUG_MODE and dev ) : args += [ '--colors' ] else : args += [ '--progress' ] if watch : args += [ '--watch' ] config_file = ( 'webpack.admin.config.js' if dev else 'webpack.prod.config.js' ) args += [ '--config {0}' . format ( config_file ) ] command = ' ' . join ( args ) ctx . run ( command , echo = True )
build static assets with webpack .