Skip to content

Commit 97457c1

Browse files
Auto deploy example to Github Pages (u-wave#1)
* surge-ify demo * Deploy to Github Pages
1 parent 6163e16 commit 97457c1

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

.babelrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const TEST = process.env.BABEL_ENV === 'test';
2+
const CJS = process.env.BABEL_ENV === 'cjs';
23

34
module.exports = {
45
presets: [
56
['@babel/env', {
6-
modules: TEST ? 'commonjs' : false,
7+
modules: TEST || CJS ? 'commonjs' : false,
78
loose: true,
89
targets: TEST ? { node: 'current' } : {},
910
}],

.travis.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- 10
5-
- 8
6-
- 7
7-
- 6
4+
- "stable"
5+
- "8"
6+
- "6"
7+
8+
before_deploy:
9+
- cd example && npm install && cd ..
10+
- mkdir _deploy
11+
- cp example/bundle.js example/index.html _deploy
12+
deploy:
13+
provider: pages
14+
skip-cleanup: true
15+
github-token: $GITHUB_TOKEN
16+
local-dir: _deploy
17+
on:
18+
branch: master
19+
node: stable

example/.babelrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../.babelrc');

example/package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"postinstall": "npm run build",
9-
"build": "browserify -t [ babelify --plugins transform-es2015-modules-commonjs ] -e app.js > bundle.js"
9+
"build": "cross-env BABEL_ENV=cjs browserify -t babelify app.js > bundle.js",
10+
"start": "ecstatic ."
1011
},
1112
"dependencies": {
13+
"ecstatic": "^3.0.0",
1214
"react": "^15.5.4",
1315
"react-dom": "^15.5.4"
1416
},
1517
"devDependencies": {
16-
"babelify": "^7.3.0",
17-
"browserify": "^13.3.0"
18+
"@babel/core": "7.0.0-beta.47",
19+
"babelify": "^9.0.0",
20+
"browserify": "^16.2.2",
21+
"cross-env": "^5.1.6"
1822
}
1923
}

0 commit comments

Comments
 (0)