mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-12 02:15:17 +00:00
run sirv in dev-mode in “development” env
This commit is contained in:
@@ -4,13 +4,16 @@ import sapper from 'sapper';
|
||||
import compression from 'compression';
|
||||
import { manifest } from './manifest/server.js';
|
||||
|
||||
const { PORT, NODE_ENV } = process.env;
|
||||
const dev = NODE_ENV === 'development';
|
||||
|
||||
polka() // You can also use Express
|
||||
.use(
|
||||
compression({ threshold: 0 }),
|
||||
sirv('assets'),
|
||||
sirv('assets', { dev }),
|
||||
sapper({ manifest })
|
||||
)
|
||||
.listen(process.env.PORT)
|
||||
.listen(PORT)
|
||||
.catch(err => {
|
||||
console.log('error', err);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user