1 | const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect')
|
2 | module.exports = function() {
|
3 |
|
4 | if (!hasRequiredFiles(['package.json', 'app.json'])) return false
|
5 |
|
6 | if (!hasRequiredDeps(['expo'])) return false
|
7 |
|
8 |
|
9 |
|
10 | const possibleArgsArrs = scanScripts({
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | preferredScriptsArr: ['web'],
|
16 | preferredCommand: 'expo start --web'
|
17 | })
|
18 |
|
19 | if (possibleArgsArrs.length === 0) {
|
20 |
|
21 | possibleArgsArrs.push(['expo', 'start', '--web'])
|
22 | }
|
23 | return {
|
24 | type: 'expo',
|
25 | command: getYarnOrNPMCommand(),
|
26 | port: 8888,
|
27 | proxyPort: 19006,
|
28 | env: { ...process.env },
|
29 | possibleArgsArrs,
|
30 | urlRegexp: new RegExp(`(http://)([^:]+:)${19006}(/)?`, 'g'),
|
31 | dist: 'web-build'
|
32 | }
|
33 | }
|