-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from hrdtbs/v2
v2
- Loading branch information
Showing
67 changed files
with
1,372 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,56 @@ | ||
const withCSS = require('@zeit/next-css') | ||
module.exports = withCSS({ | ||
target: "serverless" | ||
}) | ||
const withCSS = require("@zeit/next-css") | ||
const withOffline = require("next-offline") | ||
const compose = require("next-compose") | ||
|
||
module.exports = compose([ | ||
[ | ||
withCSS, | ||
{ | ||
target: "serverless" | ||
} | ||
], | ||
[ | ||
withOffline, | ||
{ | ||
target: "serverless", | ||
transformManifest: manifest => ["/"].concat(manifest), // add the homepage to the cache | ||
// Trying to set NODE_ENV=production when running yarn dev causes a build-time error so we | ||
// turn on the SW in dev mode so that we can actually test it | ||
generateInDevMode: true, | ||
workboxOpts: { | ||
swDest: process.env.NEXT_EXPORT ? "service-worker.js" : "static/service-worker.js", | ||
runtimeCaching: [ | ||
{ | ||
urlPattern: /^https?.*/, | ||
handler: "NetworkFirst", | ||
options: { | ||
cacheName: "https-calls", | ||
networkTimeoutSeconds: 15, | ||
expiration: { | ||
maxEntries: 150, | ||
maxAgeSeconds: 30 * 24 * 60 * 60 // 1 month | ||
}, | ||
cacheableResponse: { | ||
statuses: [0, 200] | ||
} | ||
} | ||
}, | ||
{ | ||
urlPattern: /.(?:png|webp|svg|mp4)$/, | ||
handler: "CacheFirst" | ||
} | ||
] | ||
}, | ||
experimental: { | ||
async rewrites() { | ||
return [ | ||
{ | ||
source: "/service-worker.js", | ||
destination: "/_next/static/service-worker.js" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,20 @@ | |
"author": "hrdtbs <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"next": "^9.2.1", | ||
"next": "canary", | ||
"next-compose": "^0.0.2", | ||
"next-offline": "4.0.6", | ||
"node": "^13.7.0", | ||
"now": "^16.7.3", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0" | ||
}, | ||
"dependencies": { | ||
"@zeit/next-css": "^1.0.1", | ||
"@types/react": "^16.9.19", | ||
"@types/react-dom": "^16.9.5", | ||
"@typescript-eslint/eslint-plugin": "^2.19.0", | ||
"@typescript-eslint/parser": "^2.19.0", | ||
"@zeit/next-css": "^1.0.1", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
|
@@ -40,8 +42,9 @@ | |
"typescript": "3.7.5" | ||
}, | ||
"scripts": { | ||
"dev": "node server.js", | ||
"dev": "next", | ||
"now-build": "./node_modules/.bin/next build", | ||
"start": "next start", | ||
"lint:ts": "eslint --cache", | ||
"lint:js": "eslint ./pages/**/*.js --cache --ignore-pattern .eslintrc.js", | ||
"lint:json": "prettier '*.json'", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Document, { Head, Html, Main, NextScript } from "next/document" | ||
|
||
class MyDocument extends Document { | ||
static async getInitialProps(ctx) { | ||
const initialProps = await Document.getInitialProps(ctx) | ||
return { ...initialProps } | ||
} | ||
|
||
render() { | ||
return ( | ||
<Html> | ||
<Head> | ||
<title>noavoice - presented by 望月のあ</title> | ||
<meta | ||
name="description" | ||
content="望月のあの声がいつでも聞けるサービス。疲れが取れない、辛いことがあった、そんなあなたに癒しを。" | ||
></meta> | ||
<link rel="shortcut icon" href="/static/images/icons/favicon.png" /> | ||
<link rel="manifest" href="/manifest.json" /> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:site" content="@_noach" /> | ||
<meta name="twitter:title" content="のあぼいす" /> | ||
<meta name="twitter:image" content="https://noavoice.now.sh/static/twitter-ogp.png" /> | ||
<meta name="twitter:description" content="望月のあの声がいつでも聞けるサービス" /> | ||
{/* | ||
<link rel="preconnect" href="https://fonts.gstatic.com/" crossOrigin></link> | ||
<link | ||
href="https://fonts.googleapis.com/css?family=Kosugi+Maru&display=swap&subset=japanese" | ||
rel="stylesheet" | ||
></link> | ||
<link rel="preconnect" href="https://www.google-analytics.com" crossOrigin="true" /> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-90236823-7"></script> | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-90236823-7'); | ||
` | ||
}} | ||
></script> | ||
*/} | ||
</Head> | ||
<body> | ||
<Main /> | ||
<NextScript /> | ||
</body> | ||
</Html> | ||
) | ||
} | ||
} | ||
|
||
export default MyDocument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
bec9194
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: