From 2c46b51549e8fb4b67f969a460eb1e59b09a9898 Mon Sep 17 00:00:00 2001 From: pimlie Date: Sun, 4 Aug 2019 12:23:20 +0200 Subject: [PATCH] chore: use std-ver hooks --- .versionrc | 7 +++++++ package.json | 1 - scripts/rollup.config.js | 9 ++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .versionrc diff --git a/.versionrc b/.versionrc new file mode 100644 index 0000000..6b23bf5 --- /dev/null +++ b/.versionrc @@ -0,0 +1,7 @@ +{ + "commit-all": true, + "scripts": { + "postbump": "yarn build", + "precommit": "git add -f dist/*" + } +} diff --git a/package.json b/package.json index d2832e0..ddbd61e 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "lint": "eslint src test", "prerelease": "git checkout master && git pull -r", "release": "yarn lint && yarn test && yarn build && standard-version", - "postrelease": "yarn build && git add -f dist/* && git commit --amend", "test": "yarn test:unit && yarn test:e2e-ssr && yarn test:e2e-browser", "test:e2e-ssr": "jest test/e2e/ssr", "test:e2e-browser": "jest test/e2e/browser", diff --git a/scripts/rollup.config.js b/scripts/rollup.config.js index f46d4d6..d735e5b 100644 --- a/scripts/rollup.config.js +++ b/scripts/rollup.config.js @@ -8,8 +8,10 @@ import defaultsDeep from 'lodash/defaultsDeep' const pkg = require('../package.json') +const version = pkg.version + const banner = `/** - * vue-meta v${pkg.version} + * vue-meta v${version} * (c) ${new Date().getFullYear()} * - Declan de Wet * - Sébastien Chopin (@Atinux) @@ -43,15 +45,16 @@ function rollupConfig({ values: { // replaceConfig needs to have some values 'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = true', + 'process.env.VERSION': `"${version}"` } } - // keep simple polyfills when babel plugin is used for build + /* / keep simple polyfills when babel plugin is used for build if (plugins && plugins.some(p => p.name === 'babel')) { replaceConfig.values = { 'const polyfill = process.env.NODE_ENV === \'test\'': 'const polyfill = true', } - } + }*/ return defaultsDeep({}, config, { input: 'src/browser.js',