SHARE
TWEET

webpack

a guest Apr 7th, 2020 137 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const environments = require('gulp-environments');
  2.  
  3. const development = environments.development;
  4. const production = environments.production;
  5.  
  6. const webPack = (env, gulp, plugins) => {
  7.     const config = (env === 'dev') ? '../webpack.config.clip_previewer' : '../webpack.config.clip_previewer.prod'
  8.     return plugins.mergeStream(
  9.             gulp
  10.                 .src(webpack) //path to input file
  11.                 .pipe(plugins.webpackStream({
  12.                     entry: './assets/scripts/tools/broadcast_clip_previewer/main.js',
  13.                     watch: false,
  14.                     config : require(config) //Path to config webpack
  15.                 }))
  16.                 // .pipe(plugins.concat('index.js')) //Output file
  17.                 .pipe(gulp.dest('web/js/tools/broadcast_clip_previewer/'))// path to output file
  18.         )
  19. }
  20.  
  21.  
  22. module.exports = function (gulp, plugins) {
  23.     return function () {
  24.         var webpack = ['assets/scripts/tools/broadcast_clip_previewer/main.js'];
  25.  
  26.         return development() ? webPack('dev', gulp, plugins) : webPack('prod', gulp, plugins)
  27.     }
  28. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top