mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-02 14:03:08 +02:00
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 git = require('git-last-commit');
|
||||||
import * as rimraf from 'rimraf';
|
import * as rimraf from 'rimraf';
|
||||||
import * as escapeHtml from 'escape-html';
|
import * as escapeHtml from 'escape-html';
|
||||||
|
import prominence = require('prominence');
|
||||||
|
import promiseify = require('promiseify');
|
||||||
|
|
||||||
const env = process.env.NODE_ENV;
|
const env = process.env.NODE_ENV;
|
||||||
const isProduction = env === 'production';
|
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('スクリプトを構築します...');
|
gutil.log('スクリプトを構築します...');
|
||||||
|
|
||||||
// Get commit info
|
// Get commit info
|
||||||
git.getLastCommit((err, commit) => {
|
const commit = await prominence(git).getLastCommit();
|
||||||
glob('./src/web/app/*/script.js', (err, files) => {
|
|
||||||
|
// Get all app scripts
|
||||||
|
const files = await promiseify(glob)('./src/web/app/*/script.js');
|
||||||
|
|
||||||
|
// Compile for each scripts
|
||||||
const tasks = files.map(entry => {
|
const tasks = files.map(entry => {
|
||||||
let bundle =
|
let bundle =
|
||||||
browserify({
|
browserify({
|
||||||
|
@ -243,8 +249,6 @@ gulp.task('build:client:scripts', done => {
|
||||||
|
|
||||||
es.merge(tasks).on('end', done);
|
es.merge(tasks).on('end', done);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('build:client:styles', () => {
|
gulp.task('build:client:styles', () => {
|
||||||
gutil.log('フロントサイドスタイルを構築します...');
|
gutil.log('フロントサイドスタイルを構築します...');
|
||||||
|
|
|
@ -109,6 +109,7 @@
|
||||||
"nyaize": "0.0.2",
|
"nyaize": "0.0.2",
|
||||||
"page": "1.7.1",
|
"page": "1.7.1",
|
||||||
"prominence": "0.2.0",
|
"prominence": "0.2.0",
|
||||||
|
"promiseify": "0.2.0",
|
||||||
"pug": "2.0.0-beta6",
|
"pug": "2.0.0-beta6",
|
||||||
"ratelimiter": "2.1.3",
|
"ratelimiter": "2.1.3",
|
||||||
"recaptcha-promise": "0.1.2",
|
"recaptcha-promise": "0.1.2",
|
||||||
|
|
Loading…
Reference in a new issue