Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. const gulp = require('gulp');
  2. const gulpWebpack = require('gulp-webpack');
  3. const webpack = require('webpack');
  4. const CompressionPlugin = require("compression-webpack-plugin");
  5.  
  6. gulp.task('libs', function() {
  7. gulp.src('./app/libs.js')
  8. .pipe(gulpWebpack({
  9. output: { filename: '[name].js' },
  10. module: {
  11. loaders: [
  12. {
  13. test: /.js$/,
  14. loader: 'babel-loader',
  15. query: { compact: true }
  16. }
  17. ]
  18. },
  19. plugins: [
  20. new webpack.optimize.UglifyJsPlugin({
  21. compress: { warnings: false },
  22. output: { comments: false } }
  23. ),
  24. new CompressionPlugin({
  25. asset: "[path].gz[query]",
  26. algorithm: "gzip",
  27. test: /.js$|.html$/,
  28. threshold: 10240,
  29. minRatio: 0.8
  30. })
  31. ],
  32. }, webpack))
  33. .pipe(gulp.dest('./client/js'));
  34. });
  35.  
  36. gulp.src(['./app/*.js','./app/view/**/*.js'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement