Skip to content

Fix deprecated method #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const fs = require('fs')
const { promisify } = require('util')
const exists = promisify(fs.exists)
const path = require('path')
const nextOnNetlify = require('next-on-netlify')
const { PHASE_PRODUCTION_BUILD } = require('next/constants')
const { default: loadConfig } = require('next/dist/next-server/server/config')
const makef = require('makef')
const makeDir = require('make-dir')
const pathExists = require('path-exists')
const cpx = require('cpx')
const isStaticExportProject = require('./helpers/isStaticExportProject')

Expand Down Expand Up @@ -54,7 +52,7 @@ module.exports = {
)
}

const hasNextConfig = await exists('next.config.js')
const hasNextConfig = await pathExists('next.config.js')
if (hasNextConfig) {
// If the next config exists, fail build if target isnt in acceptableTargets
const acceptableTargets = ['serverless', 'experimental-serverless-trace']
Expand Down Expand Up @@ -83,10 +81,10 @@ module.exports = {

// TO-DO: use FUNCTIONS_DIST when internal bug is fixed
const { PUBLISH_DIR } = constants
// if (!existsSync(FUNCTIONS_DIST)) {
// await makeDir(FUNCTIONS_DIST);
// if (!(await pathExists(FUNCTIONS_DIST))) {
// await makeDir(FUNCTIONS_DIST)
// }
const hasPublishDir = await exists(PUBLISH_DIR)
const hasPublishDir = await pathExists(PUBLISH_DIR)
if (!hasPublishDir) {
await makeDir(PUBLISH_DIR)
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"make-dir": "^3.1.0",
"makef": "^1.0.0",
"next": "^9.5.3",
"next-on-netlify": "^2.6.0"
"next-on-netlify": "^2.6.0",
"path-exists": "^4.0.0"
},
"devDependencies": {
"@netlify/eslint-config-node": "^0.3.0",
Expand Down