Enabled minification by default.

This commit is contained in:
Andrey Shchekin 2016-04-23 22:29:19 +12:00
Родитель 2ee1b40a05
Коммит d99f7cf4da
4 изменённых файлов: 13 добавлений и 12 удалений

1
source/Web/browserslist Normal file
Просмотреть файл

@ -0,0 +1 @@
Last 2 versions

Просмотреть файл

@ -2,19 +2,19 @@
'use strict';
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var g = require('gulp-load-plugins')();
var htmlreplace = require('gulp-html-replace');
var webpack = require('webpack-stream');
var assign = require('object-assign');
gulp.task('less', function () {
return gulp
.src('./less/app.less')
// this doesn't really work properly, e.g. https://github.com/ai/autoprefixer-core/issues/27
.pipe(g.sourcemaps.init())
.pipe(g.less())
.pipe(g.autoprefixer({ browsers: ['last 2 versions'], cascade: false }))
.pipe(g.autoprefixer({ cascade: false }))
.pipe(g.cleanCss({ processImport: false }))
.pipe(g.rename('app.min.css'))
.pipe(g.sourcemaps.write('.'))
.pipe(gulp.dest('wwwroot'));
});
@ -31,7 +31,7 @@ gulp.task('js', function () {
gulp.task('html', function () {
return gulp
.src('./index.html')
.pipe(htmlreplace({ js: 'app.min.js', css: 'app.css' }))
.pipe(g.htmlReplace({ js: 'app.min.js', css: 'app.min.css' }))
.pipe(gulp.dest('wwwroot'));
});

Просмотреть файл

@ -8,13 +8,17 @@
"babel-preset-es2015": "^6.3.13",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean-css": "^2.0.6",
"gulp-concat": "^2.6.0",
"gulp-html-replace": "^1.5.5",
"gulp-less": "^3.0.5",
"gulp-load-plugins": "^1.2.2",
"gulp-plumber": "^0.6.6",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1",
"less-plugin-autoprefix": "^1.5.1",
"less-plugin-clean-css": "^1.5.1",
"object-assign": "^4.0.1",
"webpack-stream": "^3.1.0"
},

Просмотреть файл

@ -1,17 +1,13 @@
/* globals module:false, require:false, process:false */
var webpack = require('webpack');
var plugins = [];
if (process.env.NODE_ENV === 'production') {
plugins.push(new webpack.optimize.UglifyJsPlugin());
}
module.exports = {
externals: {
jquery: 'jQuery'
},
devtool: 'source-map',
plugins: plugins,
plugins: [
new webpack.optimize.UglifyJsPlugin()
],
entry: [
'regenerator/runtime',
'./js/app.js'