-
Notifications
You must be signed in to change notification settings - Fork 345
/
next.js
29 lines (26 loc) · 871 Bytes
/
next.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect')
module.exports = function() {
// REQUIRED FILES
if (!hasRequiredFiles(['package.json'])) return false
// REQUIRED DEPS
if (!hasRequiredDeps(['next'])) return false
/** everything below now assumes that we are within gatsby */
const possibleArgsArrs = scanScripts({
preferredScriptsArr: ['dev', 'develop', 'start'],
preferredCommand: 'next'
})
if (possibleArgsArrs.length === 0) {
// ofer to run it when the user doesnt have any scripts setup! 🤯
possibleArgsArrs.push(['next'])
}
return {
framework: 'next',
command: getYarnOrNPMCommand(),
port: 8888,
proxyPort: 3000,
env: { ...process.env },
possibleArgsArrs,
urlRegexp: new RegExp(`(http:https://)([^:]+:)${3000}(/)?`, 'g'),
dist: 'out'
}
}