Compare commits

...

1 Commits

Author SHA1 Message Date
Aya Morisawa dbe4b65f6d
Move task of locales copying from webpack to gulp 2019-09-04 10:58:51 +09:00
2 changed files with 11 additions and 6 deletions

View File

@ -17,6 +17,7 @@ import * as rename from 'gulp-rename';
import * as mocha from 'gulp-mocha';
import * as replace from 'gulp-replace';
const uglifyes = require('uglify-es');
import * as fs from 'fs';
const locales = require('./locales');
@ -51,7 +52,16 @@ gulp.task('build:copy:fonts', () =>
gulp.src('./node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/client/assets/fonts/'))
);
gulp.task('build:copy', gulp.parallel('build:copy:views', 'build:copy:fonts', () =>
gulp.task('build:copy:locales', cb => {
fs.mkdirSync('./built/client/assets/locales', { recursive: true });
for (const [lang, locale] of Object.entries(locales))
fs.writeFileSync(`./built/client/assets/locales/${lang}.json`, JSON.stringify(locale), 'utf-8');
cb();
});
gulp.task('build:copy', gulp.parallel('build:copy:views', 'build:copy:fonts', 'build:copy:locales', () =>
gulp.src([
'./src/const.json',
'./src/server/web/views/**/*',

View File

@ -130,11 +130,6 @@ module.exports = {
}),
new WebpackOnBuildPlugin((stats: any) => {
fs.writeFileSync('./built/client/meta.json', JSON.stringify({ version: meta.version }), 'utf-8');
fs.mkdirSync('./built/client/assets/locales', { recursive: true });
for (const [lang, locale] of Object.entries(locales))
fs.writeFileSync(`./built/client/assets/locales/${lang}.json`, JSON.stringify(locale), 'utf-8');
}),
new VueLoaderPlugin(),
new webpack.optimize.ModuleConcatenationPlugin()