Do not use Babel's register hook in production
This commit is contained in:
parent
9a3f72f3a6
commit
5f2615f2ed
|
@ -0,0 +1 @@
|
||||||
|
web: NODE_ENV=development node -r ./modules/register.js modules/server/start.js
|
|
@ -0,0 +1,3 @@
|
||||||
|
require('babel-register')({
|
||||||
|
only: __dirname
|
||||||
|
})
|
|
@ -1,8 +1,4 @@
|
||||||
require('babel-register')({
|
import { createServer } from './index'
|
||||||
only: require('path').resolve(__dirname, './modules')
|
|
||||||
})
|
|
||||||
|
|
||||||
const createServer = require('./modules/ServerUtils').createServer
|
|
||||||
|
|
||||||
const port = process.env.PORT || 5000
|
const port = process.env.PORT || 5000
|
||||||
const registryURL = process.env.REGISTRY_URL || 'https://registry.npmjs.org'
|
const registryURL = process.env.REGISTRY_URL || 'https://registry.npmjs.org'
|
||||||
|
@ -12,11 +8,11 @@ const autoIndex = !process.env.DISABLE_INDEX
|
||||||
const redisURL = process.env.REDIS_URL
|
const redisURL = process.env.REDIS_URL
|
||||||
|
|
||||||
const server = createServer({
|
const server = createServer({
|
||||||
registryURL: registryURL,
|
registryURL,
|
||||||
bowerBundle: bowerBundle,
|
bowerBundle,
|
||||||
redirectTTL: redirectTTL,
|
redirectTTL,
|
||||||
autoIndex: autoIndex,
|
autoIndex,
|
||||||
redisURL: redisURL
|
redisURL
|
||||||
})
|
})
|
||||||
|
|
||||||
server.listen(port, () => {
|
server.listen(port, () => {
|
13
package.json
13
package.json
|
@ -1,7 +1,13 @@
|
||||||
{
|
{
|
||||||
"description": "The website for npmcdn.com",
|
"description": "The website for npmcdn.com",
|
||||||
"author": "Michael Jackson",
|
"author": "Michael Jackson",
|
||||||
|
"scripts": {
|
||||||
|
"start": "heroku local -f Procfile.local",
|
||||||
|
"build": "rimraf lib && babel ./modules -d lib",
|
||||||
|
"heroku-postbuild": "npm run build"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"babel-cli": "^6.8.0",
|
||||||
"babel-preset-es2015": "^6.6.0",
|
"babel-preset-es2015": "^6.6.0",
|
||||||
"babel-preset-react": "^6.5.0",
|
"babel-preset-react": "^6.5.0",
|
||||||
"babel-register": "^6.7.2",
|
"babel-register": "^6.7.2",
|
||||||
|
@ -13,11 +19,8 @@
|
||||||
"on-finished": "^2.3.0",
|
"on-finished": "^2.3.0",
|
||||||
"react": "^15.0.2",
|
"react": "^15.0.2",
|
||||||
"react-dom": "^15.0.2",
|
"react-dom": "^15.0.2",
|
||||||
"redis": "^2.6.0-1"
|
"redis": "^2.6.0-1",
|
||||||
},
|
"rimraf": "^2.5.2"
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/mjackson/npmcdn.com.git"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "5.8.x"
|
"node": "5.8.x"
|
||||||
|
|
Loading…
Reference in New Issue