diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-19 18:21:03 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-19 18:21:03 +0900 |
| commit | f8f90a60aed9d050d132ef9cfe72fb19ec52359b (patch) | |
| tree | cdaf5258cc7862a1b2544b837998ffddc22c307f /gulpfile.ts | |
| parent | Extract webpack config (diff) | |
| download | misskey-f8f90a60aed9d050d132ef9cfe72fb19ec52359b.tar.gz misskey-f8f90a60aed9d050d132ef9cfe72fb19ec52359b.tar.bz2 misskey-f8f90a60aed9d050d132ef9cfe72fb19ec52359b.zip | |
Clean up
Diffstat (limited to 'gulpfile.ts')
| -rw-r--r-- | gulpfile.ts | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gulpfile.ts b/gulpfile.ts index e70e13798b..30812bead9 100644 --- a/gulpfile.ts +++ b/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'); @@ -164,25 +163,36 @@ gulp.task('build:client:scripts', () => new Promise(async (ok) => { .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/')) ); |