Skip to content

Commit 55b2437

Browse files
committed
Deploy example app to useisinviewport.zdx.cat
1 parent 373573b commit 55b2437

File tree

4 files changed

+39
-7
lines changed

4 files changed

+39
-7
lines changed

.nowignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
**/*
1+
.gitignore
2+
.prettierrc
3+
.tern*
4+
LICENSE
5+
**/Readme.md
6+
cypress*
7+
node_modules
8+
.circleci

examples/cra/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cra/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dependencies": {
88
"emotion": "10.0.9",
99
"intersection-observer": "0.5.1",
10+
"observe-element-in-viewport": "0.0.11",
1011
"prettier": "^1.17.0",
1112
"react": "16.8.3",
1213
"react-dom": "16.8.3",
@@ -23,6 +24,7 @@
2324
"start-for-cypress": "./node_modules/.bin/serve -n -l 3000 ./build & ./node_modules/.bin/wait-on http://localhost:3000",
2425
"start": "npm run copy-hook && react-scripts start",
2526
"build": "npm run copy-hook && react-scripts build",
27+
"now-build": "npm run build",
2628
"test": "npm run copy-hook && react-scripts test --env=jsdom",
2729
"eject": "npm run copy-hook && react-scripts eject"
2830
},

now.json

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,32 @@
22
"name": "useIsInViewport",
33
"version": 2,
44
"alias": ["useIsInViewport.zdx.cat"],
5+
"builds": [
6+
{
7+
"src": "examples/cra/package.json",
8+
"use": "@now/static-build",
9+
"config": { "distDir": "build" }
10+
}
11+
],
512
"routes": [
613
{
7-
"src": ".*",
8-
"methods": ["GET"],
9-
"status": 302,
10-
"headers": {
11-
"Location": "https://codesandbox.io/s/54r7k92m04"
12-
}
14+
"src": "/static/(.*)",
15+
"headers": { "cache-control": "s-maxage=31536000,immutable" },
16+
"dest": "/examples/cra/static/$1"
17+
},
18+
{ "src": "/favicon.ico", "dest": "/examples/cra/favicon.ico" },
19+
{ "src": "/asset-manifest.json", "dest": "/examples/cra/asset-manifest.json" },
20+
{ "src": "/manifest.json", "dest": "/examples/cra/manifest.json" },
21+
{ "src": "/precache-manifest.(.*)", "dest": "/examples/cra/precache-manifest.$1" },
22+
{
23+
"src": "/service-worker.js",
24+
"headers": { "cache-control": "s-maxage=0" },
25+
"dest": "/examples/cra/service-worker.js"
26+
},
27+
{
28+
"src": "/(.*)",
29+
"headers": { "cache-control": "s-maxage=0" },
30+
"dest": "/examples/cra/index.html"
1331
}
1432
]
1533
}

0 commit comments

Comments
 (0)