Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周韬
node-sample
Commits
4a4702c8
Commit
4a4702c8
authored
Nov 14, 2016
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak setup for pwa-ness
parent
8a297b43
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
5 deletions
+25
-5
webpack.client.config.js
build/webpack.client.config.js
+3
-1
manifest.json
manifest.json
+13
-0
server.js
server.js
+4
-3
App.vue
src/App.vue
+1
-0
index.template.html
src/index.template.html
+4
-1
No files found.
build/webpack.client.config.js
View file @
4a4702c8
...
...
@@ -54,7 +54,9 @@ if (process.env.NODE_ENV === 'production') {
}),
new
SWPrecachePlugin
({
cacheId
:
'vue-hn'
,
filename
:
'service-worker.js'
filename
:
'service-worker.js'
,
dontCacheBustUrlsMatching
:
/./
,
staticFileGlobsIgnorePatterns
:
[
/index
\.
html$/
,
/
\.
map$/
]
})
)
}
...
...
manifest.json
0 → 100644
View file @
4a4702c8
{
"name"
:
"Vue Hackernews 2.0"
,
"short_name"
:
"Vue HN"
,
"icons"
:
[{
"src"
:
"/logo.png"
,
"sizes"
:
"48x48"
,
"type"
:
"image/png"
}],
"start_url"
:
"/"
,
"background_color"
:
"#f2f3f5"
,
"display"
:
"standalone"
,
"theme_color"
:
"#f60"
}
server.js
View file @
4a4702c8
...
...
@@ -4,7 +4,6 @@ const isProd = process.env.NODE_ENV === 'production'
const
fs
=
require
(
'fs'
)
const
path
=
require
(
'path'
)
const
express
=
require
(
'express'
)
const
favicon
=
require
(
'serve-favicon'
)
const
compression
=
require
(
'compression'
)
const
serialize
=
require
(
'serialize-javascript'
)
const
resolve
=
file
=>
path
.
resolve
(
__dirname
,
file
)
...
...
@@ -50,8 +49,10 @@ function parseIndex (template) {
}
app
.
use
(
compression
({
threshold
:
0
}))
app
.
use
(
'/dist'
,
express
.
static
(
resolve
(
'./dist'
),
{
maxAge
:
isProd
?
60
*
60
*
24
*
30
:
0
}))
app
.
use
(
favicon
(
resolve
(
'./src/assets/logo.png'
)))
const
cacheConfig
=
{
maxAge
:
isProd
?
60
*
60
*
24
*
30
:
0
}
app
.
use
(
'/dist'
,
express
.
static
(
resolve
(
'./dist'
),
cacheConfig
))
app
.
use
(
'/manifest.json'
,
express
.
static
(
resolve
(
'./manifest.json'
),
cacheConfig
))
app
.
use
(
'/logo.png'
,
express
.
static
(
resolve
(
'./src/assets/logo.png'
),
cacheConfig
))
app
.
get
(
'*'
,
(
req
,
res
)
=>
{
if
(
!
renderer
)
{
...
...
src/App.vue
View file @
4a4702c8
...
...
@@ -38,6 +38,7 @@ a
background-color #ff6600
position fixed
z-index 999
height 55px
top 0
left 0
right 0
...
...
src/index.template.html
View file @
4a4702c8
...
...
@@ -4,7 +4,10 @@
<meta
charset=
"utf-8"
>
<title>
vue-hackernews-2.0
</title>
<meta
name=
"mobile-web-app-capable"
content=
"yes"
>
<meta
name=
"viewport"
content=
"initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"
>
<link
rel=
"shortcut icon"
sizes=
"48x48"
href=
"/logo.png"
>
<meta
name=
"theme-color"
content=
"#f60"
>
<link
rel=
"manifest"
href=
"/manifest.json"
>
<link
href=
'https://fonts.googleapis.com/css?family=Roboto:300,400,700'
rel=
'stylesheet'
type=
'text/css'
>
</head>
<body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment