Created
March 3, 2020 08:33
-
-
Save tomduncalf/00070fecb68a6cf35c0102c75f166a8a to your computer and use it in GitHub Desktop.
app.js gist for running react-static dev server with Phusion Passenger
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
const pkg = require('react-static/package.json'); | |
let packageConfig = {}; | |
try { | |
packageConfig = require(path.resolve(process.cwd(), 'package.json')); | |
packageConfig = packageConfig['react-static'] || {}; | |
} catch (err) { | |
} | |
const argv = {}; | |
const options = { | |
version: argv.version || argv.v || argv.V, | |
configPath: argv.config || argv.c || argv.C, | |
name: argv.name || argv.n || argv.N, | |
template: argv.template || argv.t || argv.T, | |
staging: argv.staging || argv.s || argv.S, | |
debug: argv.debug || argv.d || argv.D, | |
incremental: argv.incremental || argv.i || argv.I, | |
analyze: argv.analyze || argv.a || argv.A, | |
isCLI: true, | |
packageConfig, | |
}; | |
require('react-static/lib/utils/binHelper') | |
require('react-static/lib/commands/start').default(options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment