UNPKG

745 BJavaScriptView Raw
1const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect')
2module.exports = function() {
3 // REQUIRED FILES
4 if (!hasRequiredFiles(['package.json', 'brunch-config.js'])) return false
5 // REQUIRED DEPS
6 if (!hasRequiredDeps(['brunch'])) return false
7
8 /** everything below now assumes that we are within gatsby */
9
10 const possibleArgsArrs = scanScripts({
11 preferredScriptsArr: ['start'],
12 preferredCommand: 'brunch watch --server'
13 })
14
15 return {
16 type: 'brunch',
17 command: getYarnOrNPMCommand(),
18 port: 8888,
19 proxyPort: 3333,
20 env: { ...process.env },
21 possibleArgsArrs,
22 urlRegexp: new RegExp(`(http://)([^:]+:)${3333}(/)?`, 'g'),
23 dist: 'app/assets'
24 }
25}