Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && npx cz --hook || true",
"pre-commit": "npm run build && git add . && enforce-branch-name '.*'",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"after:bump": "RELEASE_TAG=${version} npm run build && git add dist"
}
},
"config": {
Expand Down
14 changes: 13 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const webpack = require('webpack');
const packageJson = require('./package.json');
const { execSync } = require('child_process');
let version = process.env.RELEASE_TAG;
if (!version) {
try {
version = execSync('git describe --tags --abbrev=0').toString().trim();
if (version.startsWith('v')) {
version = version.slice(1);
}
} catch (err) {
version = packageJson.version;
}
}

const extractStyles = new ExtractTextPlugin({
filename: './app.css', // this is output name for file
Expand All @@ -23,7 +35,7 @@ const plugins = [
extractStyles,
listStyles,
new webpack.BannerPlugin({
banner: `Chimera UI Libraries - Build ${packageJson.version} (${date})
banner: `Chimera UI Libraries - Build ${version} (${date})
`,
entryOnly: true,
}),
Expand Down
Loading