Refactor
This commit is contained in:
parent
05e563db8f
commit
66dbfaae9b
2 changed files with 63 additions and 58 deletions
14
gulpfile.ts
14
gulpfile.ts
|
@ -25,6 +25,8 @@ import pug = require('gulp-pug');
|
|||
import git = require('git-last-commit');
|
||||
import * as rimraf from 'rimraf';
|
||||
import * as escapeHtml from 'escape-html';
|
||||
import prominence = require('prominence');
|
||||
import promiseify = require('promiseify');
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
const isProduction = env === 'production';
|
||||
|
@ -175,12 +177,16 @@ gulp.task('build:client', [
|
|||
}
|
||||
});
|
||||
|
||||
gulp.task('build:client:scripts', done => {
|
||||
gulp.task('build:client:scripts', async (done) => {
|
||||
gutil.log('スクリプトを構築します...');
|
||||
|
||||
// Get commit info
|
||||
git.getLastCommit((err, commit) => {
|
||||
glob('./src/web/app/*/script.js', (err, files) => {
|
||||
const commit = await prominence(git).getLastCommit();
|
||||
|
||||
// Get all app scripts
|
||||
const files = await promiseify(glob)('./src/web/app/*/script.js');
|
||||
|
||||
// Compile for each scripts
|
||||
const tasks = files.map(entry => {
|
||||
let bundle =
|
||||
browserify({
|
||||
|
@ -242,8 +248,6 @@ gulp.task('build:client:scripts', done => {
|
|||
});
|
||||
|
||||
es.merge(tasks).on('end', done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build:client:styles', () => {
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
"nyaize": "0.0.2",
|
||||
"page": "1.7.1",
|
||||
"prominence": "0.2.0",
|
||||
"promiseify": "0.2.0",
|
||||
"pug": "2.0.0-beta6",
|
||||
"ratelimiter": "2.1.3",
|
||||
"recaptcha-promise": "0.1.2",
|
||||
|
|
Loading…
Reference in a new issue