diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-03 07:32:18 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-03 07:32:18 +0900 |
| commit | 6ba1035b69e8a3c4413d343b893ea6d9254e951f (patch) | |
| tree | 310582e5dad44d50ddc3bc3c7cb1d6f9fdfafe51 /webpack/plugins/index.ts | |
| parent | :v: (diff) | |
| download | misskey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.tar.gz misskey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.tar.bz2 misskey-6ba1035b69e8a3c4413d343b893ea6d9254e951f.zip | |
nanka iroiro
Closes #1168, #1169
Diffstat (limited to 'webpack/plugins/index.ts')
| -rw-r--r-- | webpack/plugins/index.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index b97cde231d..4023cd6cba 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -1,4 +1,7 @@ +import * as fs from 'fs'; import * as webpack from 'webpack'; +const WebpackOnBuildPlugin = require('on-build-webpack'); +const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const ProgressBarPlugin = require('progress-bar-webpack-plugin'); import chalk from 'chalk'; @@ -11,6 +14,7 @@ const isProduction = env === 'production'; export default (version, lang) => { const plugins = [ + new HardSourceWebpackPlugin(), new ProgressBarPlugin({ format: chalk` {cyan.bold yes we can} {bold [}:bar{bold ]} {green.bold :percent} {gray (:current/:total)} :elapseds`, clear: false @@ -20,6 +24,11 @@ export default (version, lang) => { 'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV) } + }), + new WebpackOnBuildPlugin(stats => { + fs.writeFileSync('./version.json', JSON.stringify({ + version + }), 'utf-8'); }) ]; |