Skip to content

Commit 50eef41

Browse files
committed
chore: Add version override when building a new version
1 parent 3854dfb commit 50eef41

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

build/config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const replace = require('rollup-plugin-replace')
55
const flow = require('rollup-plugin-flow-no-whitespace')
66
const path = require('path')
77

8-
const Vue = require('vue/package.json')
9-
const NSVue = require('../package.json')
8+
const VueVersion = require('vue/package.json').version
9+
const NSVueVersion = process.env.VERSION || require('../package.json').version
1010

1111
const banner = (name, version) => `
1212
/*!
13-
* ${name} v${version || NSVue.version}
14-
* (Using Vue v${Vue.version})
13+
* ${name} v${version || NSVueVersion}
14+
* (Using Vue v${VueVersion})
1515
* (c) 2017-${new Date().getFullYear()} rigor789
1616
* Released under the MIT license.
1717
*/
@@ -64,11 +64,11 @@ const genConfig = (name) => {
6464
plugins: [
6565
replace({
6666
__WEEX__: false,
67-
__VERSION__: Vue.version,
67+
__VERSION__: VueVersion,
6868
'process.env.NODE_ENV': "'development'",
6969
'let _isServer': 'let _isServer = false',
70-
'process.env.VUE_VERSION': `'${Vue.version}'`,
71-
'process.env.NS_VUE_VERSION': `'${NSVue.version}'`
70+
'process.env.VUE_VERSION': `'${VueVersion}'`,
71+
'process.env.NS_VUE_VERSION': `'${NSVueVersion}'`
7272
}),
7373
flow(),
7474
buble(),

build/releaser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ inquirer
4040
echo "Running tests..."
4141
npm run test
4242
echo "Starting build..."
43-
npm run build
43+
VERSION=${version} npm run build
4444
echo "Build Successful. Updating packages"
4545
cd packages/nativescript-vue-template-compiler && npm version ${version} && npm publish
4646
git add -A

0 commit comments

Comments
 (0)