Добавление поддержки баннера

This commit is contained in:
2024-03-20 14:20:44 +04:00
parent a08d3c2e4e
commit 5ad296e61e
8 changed files with 119 additions and 74 deletions
+21
View File
@@ -0,0 +1,21 @@
const path = require('path');
const webpack = require('webpack');
const rootDir = path.resolve(__dirname);
const date = (new Date()).toLocaleDateString("ru-RU", 'yyyy-MM-dd');
const pckg = require(path.join(rootDir, 'package.json'));
const bannerContent = `
${pckg.name} ${pckg.version} (${date})
${pckg.homepage}
${pckg.description}
@author ${pckg.author.name}
@license ${pckg.license}
`.trim();
const libBanner = new webpack.BannerPlugin({
banner: bannerContent,
test: /\.js$/
});
module.exports = { libBanner };