Skip to content

Commit d70bacf

Browse files
committed
adjust build setup
1 parent f8561a9 commit d70bacf

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

release.sh renamed to build/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [[ $REPLY =~ ^[Yy]$ ]]
88
then
99
echo "Releasing $VERSION ..."
1010
npm test
11-
npm run build
11+
VERSION=$VERSION npm run build
1212

1313
# commit
1414
git add -A

rollup.config.js renamed to build/rollup.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const flow = require('rollup-plugin-flow')
33
const cjs = require('rollup-plugin-commonjs')
44
const node = require('rollup-plugin-node-resolve')
55
const replace = require('rollup-plugin-replace')
6+
const version = process.env.VERSION || require('../package.json').version
67

78
module.exports = {
89
entry: 'src/index.js',
@@ -17,5 +18,11 @@ module.exports = {
1718
node(),
1819
cjs(),
1920
buble()
20-
]
21+
],
22+
banner:
23+
`/**
24+
* vue-router v${version}
25+
* (c) ${new Date().getFullYear()} Evan You
26+
* @license MIT
27+
*/`
2128
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
],
1818
"scripts": {
1919
"dev": "node examples/server.js",
20-
"dev:dist": "rollup -wcm",
21-
"build": "rollup -c && uglifyjs dist/vue-router.js -c -m -o dist/vue-router.min.js",
20+
"dev:dist": "rollup -wm -c build/rollup.config.js",
21+
"build": "rollup -c build/rollup.config.js && uglifyjs dist/vue-router.js -cm --comments -o dist/vue-router.min.js",
2222
"lint": "eslint src examples",
2323
"test": "npm run lint && flow check && npm run test:unit && npm run test:e2e",
2424
"test:unit": "jasmine JASMINE_CONFIG_PATH=test/unit/jasmine.json",
2525
"test:e2e": "node test/e2e/runner.js",
26-
"release": "bash release.sh"
26+
"release": "bash build/release.sh"
2727
},
2828
"devDependencies": {
2929
"babel-core": "^6.11.4",

0 commit comments

Comments
 (0)