diff --git a/webpack/plugins/banner.ts b/webpack/plugins/banner.ts new file mode 100644 index 0000000000..9632905948 --- /dev/null +++ b/webpack/plugins/banner.ts @@ -0,0 +1,6 @@ +import * as webpack from 'webpack'; + +export default version => new webpack.BannerPlugin({ + banner: `Misskey v${version} - built at ${new Date()} | (c) syuilo 2014-2017 + hash:[hash], chunkhash:[chunkhash], name:[name], filebase:[filebase], query:[query], file:[file]` +}); diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index cbffbad4e0..c353507264 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -2,11 +2,12 @@ const StringReplacePlugin = require('string-replace-webpack-plugin'); import constant from './const'; import minify from './minify'; +import banner from './banner'; const env = process.env.NODE_ENV; const isProduction = env === 'production'; -export default () => { +export default version => { const plugins = [ constant(), new StringReplacePlugin() @@ -16,5 +17,7 @@ export default () => { plugins.push(minify()); } + plugins.push(banner(version)); + return plugins; }; diff --git a/webpack/webpack.config.ts b/webpack/webpack.config.ts index 50733a6cff..0154d3b191 100644 --- a/webpack/webpack.config.ts +++ b/webpack/webpack.config.ts @@ -29,7 +29,7 @@ module.exports = langs.map(([lang, locale]) => { name, entry, module: module_(lang, locale), - plugins: plugins(), + plugins: plugins(version), output }; });