From 90abab6c2556d38a005b6a52a5fc5996625092d9 Mon Sep 17 00:00:00 2001 From: liabru Date: Tue, 24 Nov 2020 23:45:18 +0000 Subject: [PATCH] update build script --- webpack.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 1916a42..7174511 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,6 +4,7 @@ const webpack = require('webpack'); const path = require('path'); const pkg = require('./package.json'); +const fs = require('fs'); const execSync = require('child_process').execSync; module.exports = (env = {}) => { @@ -14,13 +15,14 @@ module.exports = (env = {}) => { const commitHash = execSync('git rev-parse --short HEAD').toString().trim(); const version = !alpha ? pkg.version : `${pkg.version}-alpha+${commitHash}`; + const license = fs.readFileSync('LICENSE', 'utf8'); const date = new Date().toISOString().slice(0, 10); const name = 'matter'; const alphaInfo = 'Experimental pre-release build.\n '; const banner = -` ${pkg.name} ${version} by @liabru (c) ${date} - ${alpha ? alphaInfo : ''}${pkg.homepage} - License ${pkg.license}`; +`${pkg.name} ${version} by @liabru ${date} +${alpha ? alphaInfo : ''}${pkg.homepage} +License ${pkg.license}${!minimize ? '\n\n' + license : ''}`; return { entry: { [name]: './src/module/main.js' },