mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
Add banner into built script files
This commit is contained in:
parent
df77a546b6
commit
d00237b766
6
webpack/plugins/banner.ts
Normal file
6
webpack/plugins/banner.ts
Normal file
@ -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]`
|
||||||
|
});
|
@ -2,11 +2,12 @@ const StringReplacePlugin = require('string-replace-webpack-plugin');
|
|||||||
|
|
||||||
import constant from './const';
|
import constant from './const';
|
||||||
import minify from './minify';
|
import minify from './minify';
|
||||||
|
import banner from './banner';
|
||||||
|
|
||||||
const env = process.env.NODE_ENV;
|
const env = process.env.NODE_ENV;
|
||||||
const isProduction = env === 'production';
|
const isProduction = env === 'production';
|
||||||
|
|
||||||
export default () => {
|
export default version => {
|
||||||
const plugins = [
|
const plugins = [
|
||||||
constant(),
|
constant(),
|
||||||
new StringReplacePlugin()
|
new StringReplacePlugin()
|
||||||
@ -16,5 +17,7 @@ export default () => {
|
|||||||
plugins.push(minify());
|
plugins.push(minify());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins.push(banner(version));
|
||||||
|
|
||||||
return plugins;
|
return plugins;
|
||||||
};
|
};
|
||||||
|
@ -29,7 +29,7 @@ module.exports = langs.map(([lang, locale]) => {
|
|||||||
name,
|
name,
|
||||||
entry,
|
entry,
|
||||||
module: module_(lang, locale),
|
module: module_(lang, locale),
|
||||||
plugins: plugins(),
|
plugins: plugins(version),
|
||||||
output
|
output
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user