Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const gulp = require('gulp');
- const gulpWebpack = require('gulp-webpack');
- const webpack = require('webpack');
- const CompressionPlugin = require("compression-webpack-plugin");
- gulp.task('libs', function() {
- gulp.src('./app/libs.js')
- .pipe(gulpWebpack({
- output: { filename: '[name].js' },
- module: {
- loaders: [
- {
- test: /.js$/,
- loader: 'babel-loader',
- query: { compact: true }
- }
- ]
- },
- plugins: [
- new webpack.optimize.UglifyJsPlugin({
- compress: { warnings: false },
- output: { comments: false } }
- ),
- new CompressionPlugin({
- asset: "[path].gz[query]",
- algorithm: "gzip",
- test: /.js$|.html$/,
- threshold: 10240,
- minRatio: 0.8
- })
- ],
- }, webpack))
- .pipe(gulp.dest('./client/js'));
- });
- gulp.src(['./app/*.js','./app/view/**/*.js'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement