diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-15 19:59:07 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-15 19:59:07 +0900 |
| commit | 58a6e647b3534262943903ae044eec336877e414 (patch) | |
| tree | 98fe1fe55893535be5caabee4ed7591e23681fbf /webpack/plugins | |
| parent | wip (diff) | |
| download | misskey-58a6e647b3534262943903ae044eec336877e414.tar.gz misskey-58a6e647b3534262943903ae044eec336877e414.tar.bz2 misskey-58a6e647b3534262943903ae044eec336877e414.zip | |
wip
Diffstat (limited to 'webpack/plugins')
| -rw-r--r-- | webpack/plugins/banner.ts | 10 | ||||
| -rw-r--r-- | webpack/plugins/consts.ts | 6 | ||||
| -rw-r--r-- | webpack/plugins/index.ts | 9 |
3 files changed, 6 insertions, 19 deletions
diff --git a/webpack/plugins/banner.ts b/webpack/plugins/banner.ts deleted file mode 100644 index a8774e0a39..0000000000 --- a/webpack/plugins/banner.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as os from 'os'; -import * as webpack from 'webpack'; - -export default version => new webpack.BannerPlugin({ - banner: - `Misskey v${version} | MIT Licensed, (c) syuilo 2014-2018\n` + - 'https://github.com/syuilo/misskey\n' + - `built by ${os.hostname()} at ${new Date()}\n` + - 'hash:[hash], chunkhash:[chunkhash]' -}); diff --git a/webpack/plugins/consts.ts b/webpack/plugins/consts.ts index 16a5691622..a01c18af6f 100644 --- a/webpack/plugins/consts.ts +++ b/webpack/plugins/consts.ts @@ -7,6 +7,7 @@ import * as webpack from 'webpack'; import version from '../../src/version'; const constants = require('../../src/const.json'); import config from '../../src/conf'; +import { licenseHtml } from '../../src/common/build/license'; export default lang => { const consts = { @@ -24,6 +25,7 @@ export default lang => { _LANG_: lang, _HOST_: config.host, _URL_: config.url, + _LICENSE_: licenseHtml }; const _consts = {}; @@ -32,7 +34,5 @@ export default lang => { _consts[key] = JSON.stringify(consts[key]); }); - return new webpack.DefinePlugin(Object.assign({}, _consts, { - __CONSTS__: JSON.stringify(consts) - })); + return new webpack.DefinePlugin(_consts); }; diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index d97f781558..a29d2b7e2f 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -1,17 +1,16 @@ -const StringReplacePlugin = require('string-replace-webpack-plugin'); +const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); import consts from './consts'; import hoist from './hoist'; import minify from './minify'; -import banner from './banner'; const env = process.env.NODE_ENV; const isProduction = env === 'production'; export default (version, lang) => { const plugins = [ - consts(lang), - new StringReplacePlugin() + new HardSourceWebpackPlugin(), + consts(lang) ]; if (isProduction) { @@ -19,7 +18,5 @@ export default (version, lang) => { plugins.push(minify()); } - plugins.push(banner(version)); - return plugins; }; |