From b16dabc4eab4381134ae2182439efc3a670da034 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 12 Nov 2018 04:09:02 +0900 Subject: [PATCH] [Client] Enable code splitting And some optimizations --- gulpfile.ts | 11 +- package.json | 2 + src/client/app/common/scripts/get-md5.ts | 14 +- .../app/common/views/components/emoji.vue | 11 +- .../common/views/directives/autocomplete.ts | 5 +- .../desktop/views/components/game-window.vue | 2 +- .../app/desktop/views/pages/games/reversi.vue | 2 +- .../app/mobile/views/pages/games/reversi.vue | 2 +- src/client/app/tsconfig.json | 2 +- webpack.config.ts | 146 +++++++----------- 10 files changed, 82 insertions(+), 115 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index 029979c35..2b420f5fe 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -57,16 +57,7 @@ gulp.task('build:copy:views', () => gulp.src('./src/server/web/views/**/*').pipe(gulp.dest('./built/server/web/views')) ); -// 互換性のため -gulp.task('build:copy:lang', () => - gulp.src(['./built/client/assets/*.*-*.js']) - .pipe(rename(path => { - path.basename = path.basename.replace(/\-(.*)$/, ''); - })) - .pipe(gulp.dest('./built/client/assets/')) -); - -gulp.task('build:copy', ['build:copy:views', 'build:copy:lang'], () => +gulp.task('build:copy', ['build:copy:views'], () => gulp.src([ './build/Release/crypto_key.node', './src/const.json', diff --git a/package.json b/package.json index 68cdf98d1..19b04debf 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "commander": "2.19.0", "crc-32": "1.2.0", "css-loader": "1.0.1", + "cssnano": "4.1.7", "dateformat": "3.0.3", "debug": "4.1.0", "deep-equal": "1.0.1", @@ -167,6 +168,7 @@ "os-utils": "0.0.14", "parse5": "5.1.0", "portscanner": "2.2.0", + "postcss-loader": "3.0.0", "progress-bar-webpack-plugin": "1.11.0", "promise-limit": "2.7.0", "promise-sequential": "1.1.1", diff --git a/src/client/app/common/scripts/get-md5.ts b/src/client/app/common/scripts/get-md5.ts index 24ac04c1a..51a45b30d 100644 --- a/src/client/app/common/scripts/get-md5.ts +++ b/src/client/app/common/scripts/get-md5.ts @@ -1,8 +1,10 @@ -const crypto = require('crypto'); +// スクリプトサイズがデカい +//const crypto = require('crypto'); export default (data: ArrayBuffer) => { - const buf = new Buffer(data); - const hash = crypto.createHash("md5"); - hash.update(buf); - return hash.digest("hex"); -}; \ No newline at end of file + //const buf = new Buffer(data); + //const hash = crypto.createHash("md5"); + //hash.update(buf); + //return hash.digest("hex"); + return ''; +}; diff --git a/src/client/app/common/views/components/emoji.vue b/src/client/app/common/views/components/emoji.vue index 2fb7055f0..c57d6a944 100644 --- a/src/client/app/common/views/components/emoji.vue +++ b/src/client/app/common/views/components/emoji.vue @@ -7,7 +7,8 @@