nanka iroiro
This commit is contained in:
parent
6927ffa979
commit
5ad77e8a3a
10 changed files with 155 additions and 93 deletions
39
gulpfile.ts
39
gulpfile.ts
|
@ -19,13 +19,16 @@ import * as chalk from 'chalk';
|
|||
import imagemin = require('gulp-imagemin');
|
||||
import * as rename from 'gulp-rename';
|
||||
import * as mocha from 'gulp-mocha';
|
||||
import * as replace from 'gulp-replace';
|
||||
import getVersion from './src/version';
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
const isProduction = env === 'production';
|
||||
const isDebug = !isProduction;
|
||||
|
||||
if (isDebug) {
|
||||
console.log(chalk.yellow.bold('!!!WARNING!!! NODE_ENV is not "production". (built script compessing will not be performed.)'));
|
||||
console.warn(chalk.yellow.bold('WARNING! NODE_ENV is not "production".'));
|
||||
console.warn(chalk.yellow.bold(' built script compessing will not be performed.'));
|
||||
}
|
||||
|
||||
const constants = require('./src/const.json');
|
||||
|
@ -126,15 +129,21 @@ gulp.task('build:client', [
|
|||
'copy:client'
|
||||
]);
|
||||
|
||||
gulp.task('build:client:scripts', () =>
|
||||
es.merge(
|
||||
webpack(require('./webpack.config'), require('webpack'))
|
||||
.pipe(gulp.dest('./built/web/resources/')) as any,
|
||||
gulp.src('./src/web/app/client/script.js')
|
||||
//.pipe(isProduction ? uglify() : gutil.noop())
|
||||
.pipe(gulp.dest('./built/web/resources/client/')) as any
|
||||
)
|
||||
);
|
||||
gulp.task('build:client:scripts', done => {
|
||||
getVersion.then(version => {
|
||||
require('./webpack.config').then(webpackOptions => {
|
||||
es.merge(
|
||||
webpack(webpackOptions, require('webpack'))
|
||||
.pipe(gulp.dest('./built/web/resources/')) as any,
|
||||
gulp.src('./src/web/app/client/script.js')
|
||||
.pipe(replace('VERSION', JSON.stringify(version)))
|
||||
//.pipe(isProduction ? uglify() : gutil.noop())
|
||||
.pipe(gulp.dest('./built/web/resources/client/')) as any
|
||||
);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build:client:styles', () =>
|
||||
gulp.src('./src/web/app/init.css')
|
||||
|
@ -163,12 +172,16 @@ gulp.task('build:client:pug', [
|
|||
'copy:client',
|
||||
'build:client:scripts',
|
||||
'build:client:styles'
|
||||
], () =>
|
||||
], done => {
|
||||
getVersion.then(version => {
|
||||
gulp.src('./src/web/app/*/view.pug')
|
||||
.pipe(pug({
|
||||
locals: {
|
||||
version: version,
|
||||
themeColor: constants.themeColor
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('./built/web/app/'))
|
||||
);
|
||||
.pipe(gulp.dest('./built/web/app/'));
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue