0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-25 13:39:06 -05:00

update build script

This commit is contained in:
liabru 2020-11-24 23:45:18 +00:00
parent ceb7cd54e1
commit 90abab6c25

View file

@ -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' },