diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-16 15:32:40 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-16 15:32:40 +0900 |
| commit | 58f124e4fc166d079cae24d4c144d1cc5ecd1ebb (patch) | |
| tree | bd5074998ce7a3bd2341a8810564cf9006b000a0 | |
| parent | v4933 (diff) | |
| download | sharkey-58f124e4fc166d079cae24d4c144d1cc5ecd1ebb.tar.gz sharkey-58f124e4fc166d079cae24d4c144d1cc5ecd1ebb.tar.bz2 sharkey-58f124e4fc166d079cae24d4c144d1cc5ecd1ebb.zip | |
:v:
| -rw-r--r-- | src/server/web/index.ts | 4 | ||||
| -rw-r--r-- | webpack.config.ts | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 376aadda73..eba0c372b0 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -31,7 +31,9 @@ const router = new Router(); //#region static assets router.get('/assets/*', async ctx => { - await send(ctx, ctx.path, { + // 無圧縮スクリプトを用意するのは大変なので一時的に無効化 + const path = process.env.NODE_ENV == 'production' ? ctx.path.replace('raw.js', 'min.js') : ctx.path.replace('min.js', 'raw.js'); + await send(ctx, path, { root: client, maxage: ms('7 days'), immutable: true diff --git a/webpack.config.ts b/webpack.config.ts index bc876e067d..50e28972ac 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -40,8 +40,12 @@ global['base64replacement'] = (_, key) => { const langs = Object.keys(locales); +// 無圧縮スクリプトを用意するのは重いので一時的に無効化 +//const entries = process.env.NODE_ENV == 'production' +// ? langs.map(l => [l, false]).concat(langs.map(l => [l, true])) +// : langs.map(l => [l, false]); const entries = process.env.NODE_ENV == 'production' - ? langs.map(l => [l, false]).concat(langs.map(l => [l, true])) + ? langs.map(l => [l, true]) : langs.map(l => [l, false]); module.exports = entries.map(x => { |