Skip to content

Commit 4c6dc1b

Browse files
committed
[fixed] Installing on Windows
Fixes #1577
1 parent 7c1edc6 commit 4c6dc1b

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"stage": 0,
3+
"loose": "all",
34
"plugins": [ "object-assign" ]
45
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
"homepage": "https://rackt.github.io/react-router/",
1111
"bugs": "https://github.com/rackt/react-router/issues",
1212
"scripts": {
13-
"build": "scripts/build.sh",
13+
"build": "babel ./modules -d lib --ignore '__tests__'",
14+
"build-umd": "NODE_ENV=production webpack modules/index.js lib/umd/History.js",
15+
"build-min": "NODE_ENV=production webpack -p modules/index.js lib/umd/History.min.js",
1416
"build-website": "scripts/build-website.sh",
15-
"prepublish": "npm run build",
1617
"examples": "webpack-dev-server --config examples/webpack.config.js --content-base examples --inline",
17-
"test": "eslint modules && karma start"
18+
"test": "eslint modules && karma start",
19+
"prepublish": "npm run build"
1820
},
1921
"authors": [
2022
"Ryan Florence",

scripts/release.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,19 @@ update_version() {
77
echo "Updated ${1} version to ${2}"
88
}
99

10+
validate_semver() {
11+
if ! [[ $1 =~ ^[0-9]\.[0-9]+\.[0-9](-.+)? ]]; then
12+
echo "Version $1 is not valid! It must be a valid semver string like 1.0.2 or 2.3.0-beta.1"
13+
exit 1
14+
fi
15+
}
16+
1017
current_version=$(node -p "require('./package').version")
1118

1219
printf "Next version (current is $current_version)? "
1320
read next_version
1421

15-
if ! [[ $next_version =~ ^[0-9]\.[0-9]+\.[0-9](-.+)? ]]; then
16-
echo "Version must be a valid semver string, e.g. 1.0.2 or 2.3.0-beta.1"
17-
exit 1
18-
fi
22+
validate_semver $next_version
1923

2024
next_ref="v$next_version"
2125

@@ -26,8 +30,12 @@ update_version 'package.json' $next_version
2630
$changelog -t $next_ref
2731

2832
npm run build
29-
git add -A build
33+
npm run build-umd
34+
npm run build-min
3035

36+
echo "gzipped, the UMD build is `gzip -c lib/umd/ReactRouter.min.js | wc -c | sed -e 's/^[[:space:]]*//'` bytes"
37+
38+
git add -A build
3139
git commit -am "Version $next_version"
3240

3341
git tag $next_ref
@@ -37,8 +45,7 @@ git push origin master
3745
git push origin $next_ref
3846
git push origin latest -f
3947

40-
npm publish build
48+
npm publish
4149

4250
echo "# Publishing docs website"
4351
./publish-docs.sh
44-

0 commit comments

Comments
 (0)