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

with-firebase-hosting: fix npm scripts, remove firebase.json predeploy scripts (#4593)

* remove `predeploy` scripts from `firebase.json` in favour of `npm` `pre` scripts as they are consistent across `deploy` and `serve` commands. (to revisit once Firebase add support in the `firebase.json` for `preserve`)
* update deps
* workaround some bug where Babel could not resolve the standard `next/babel` config. Explicitly defining this seems to remove the issue.
* closes #4562
This commit is contained in:
James Hegedus 2018-06-13 01:37:13 +10:00 committed by Tim Neutkens
parent e2beadd960
commit 4f4b7a1bce
3 changed files with 25 additions and 17 deletions

View file

@ -6,11 +6,9 @@
"source": "**/**",
"function": "next"
}
],
"predeploy": "npm run build-public"
]
},
"functions": {
"source": "dist/functions",
"predeploy": "npm run build-funcs && npm run build-app && npm run copy-deps"
"source": "dist/functions"
}
}
}

View file

@ -1,29 +1,36 @@
{
"name": "with-firebase-hosting",
"version": "4.0.0",
"description": "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.",
"version": "4.0.1",
"description":
"Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.",
"scripts": {
"dev": "next \"src/app\"",
"dev": "next \"src/app/\"",
"preserve":
"npm run build-public && npm run build-funcs && npm run build-app && npm run copy-deps && npm run install-deps",
"serve": "NODE_ENV=production firebase serve",
"predeploy":
"npm run build-public && npm run build-funcs && npm run build-app && npm run copy-deps",
"deploy": "firebase deploy",
"clean": "rimraf \"dist/functions/**\" && rimraf \"dist/public\"",
"build-public": "cpx \"src/public/**/*.*\" \"dist/public\" -C",
"build-funcs": "babel \"src/functions\" --out-dir \"dist/functions\"",
"build-app": "next build \"src/app\"",
"copy-deps": "cpx \"*{package.json,package-lock.json,yarn.lock}\" \"dist/functions\" -C"
"build-app": "next build \"src/app/\"",
"copy-deps":
"cpx \"*{package.json,package-lock.json,yarn.lock}\" \"dist/functions\" -C",
"install-deps": "cd \"dist/functions\" && npm i"
},
"dependencies": {
"firebase-admin": "5.12.1",
"firebase-functions": "1.0.2",
"next": "latest",
"react": "16.3.2",
"react-dom": "16.3.2"
"firebase-admin": "^5.12.1",
"firebase-functions": "^1.0.2",
"next": "^6.0.3",
"react": "^16.3.2",
"react-dom": "^16.3.2"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.42",
"@babel/cli": "^7.0.0-beta.42",
"cpx": "1.5.0",
"firebase-tools": "3.18.4",
"prettier": "1.12.1",
"rimraf": "2.6.2"
}
}
}

View file

@ -0,0 +1,3 @@
{
"presets": [["next/babel"]]
}