Clean up
This commit is contained in:
parent
cbf9044577
commit
f8f90a60ae
5 changed files with 82 additions and 68 deletions
30
gulpfile.ts
30
gulpfile.ts
|
@ -12,7 +12,6 @@ import * as tslint from 'gulp-tslint';
|
|||
import * as glob from 'glob';
|
||||
import * as es from 'event-stream';
|
||||
import * as webpack from 'webpack-stream';
|
||||
import stylus = require('gulp-stylus');
|
||||
import cssnano = require('gulp-cssnano');
|
||||
import * as uglify from 'gulp-uglify';
|
||||
import riotify = require('riotify');
|
||||
|
@ -160,29 +159,40 @@ gulp.task('build:client:scripts', () => new Promise(async (ok) => {
|
|||
// TODO: remove this block
|
||||
if (isProduction) {
|
||||
stream = stream
|
||||
// ↓ https://github.com/mishoo/UglifyJS2/issues/448
|
||||
.pipe(babel({
|
||||
presets: ['es2015']
|
||||
}))
|
||||
.pipe(uglify());
|
||||
}
|
||||
|
||||
let entryPointStream = gulp.src('./src/web/app/client/script.js');
|
||||
|
||||
if (isProduction) {
|
||||
entryPointStream = entryPointStream
|
||||
// ↓ https://github.com/mishoo/UglifyJS2/issues/448
|
||||
.pipe(babel({
|
||||
presets: ['es2015']
|
||||
}))
|
||||
.pipe(uglify({
|
||||
compress: true
|
||||
mangle: {
|
||||
toplevel: true
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
stream.pipe(gulp.dest('./built/web/resources/'));
|
||||
es.merge(
|
||||
stream.pipe(gulp.dest('./built/web/resources/')),
|
||||
entryPointStream.pipe(gulp.dest('./built/web/resources/client/'))
|
||||
);
|
||||
|
||||
ok();
|
||||
}));
|
||||
|
||||
gulp.task('build:client:styles', () =>
|
||||
gulp.src('./src/web/app/init.styl')
|
||||
.pipe(stylus({
|
||||
compress: true
|
||||
}))
|
||||
gulp.src('./src/web/app/init.css')
|
||||
.pipe(isProduction
|
||||
? cssnano({
|
||||
safe: true // 高度な圧縮は無効にする (一部デザインが不適切になる場合があるため)
|
||||
})
|
||||
? cssnano()
|
||||
: gutil.noop())
|
||||
.pipe(gulp.dest('./built/web/resources/'))
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue