1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

set build and start npm scripts on all examples (#549)

This commit is contained in:
Naoyuki Kanezawa 2016-12-29 03:12:24 +09:00 committed by Guillermo Rauch
parent b0eb0ea353
commit 917a96a1cd
8 changed files with 20 additions and 8 deletions

View file

@ -1,6 +1,8 @@
{
"scripts": {
"dev": "node server.js"
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"express": "^4.14.0",

View file

@ -1,7 +1,8 @@
const express = require('express')
const next = require('next')
const app = next({ dir: '.', dev: true })
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dir: '.', dev })
const handle = app.getRequestHandler()
app.prepare()

View file

@ -1,6 +1,8 @@
{
"scripts": {
"dev": "node server.js"
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"next": "^2.0.0-beta"

View file

@ -2,7 +2,8 @@ const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')
const app = next({ dev: true })
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare()

View file

@ -1,6 +1,8 @@
{
"scripts": {
"dev": "node server.js"
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"next": "^2.0.0-beta",

View file

@ -3,7 +3,8 @@ const { parse } = require('url')
const next = require('next')
const pathMatch = require('path-match')
const app = next({ dev: true })
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
const route = pathMatch()
const match = route('/blog/:id')

View file

@ -1,6 +1,8 @@
{
"scripts": {
"dev": "node server.js"
"dev": "node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"express": "^4.14.0",

View file

@ -2,7 +2,8 @@ const express = require('express')
const next = require('next')
const LRUCache = require('lru-cache')
const app = next({ dir: '.', dev: true })
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dir: '.', dev })
const handle = app.getRequestHandler()
// This is where we cache our rendered HTML pages