-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e7d443
commit 2e55901
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect') | ||
module.exports = function() { | ||
// REQUIRED FILES | ||
if (!hasRequiredFiles(['package.json', 'app.json'])) return false | ||
// REQUIRED DEPS | ||
if (!hasRequiredDeps(['expo'])) return false | ||
|
||
/** everything below now assumes that we are within expo */ | ||
|
||
const possibleArgsArrs = scanScripts({ | ||
preferredScriptsArr: ['web'], | ||
preferredCommand: 'expo start --web' | ||
}) | ||
|
||
if (possibleArgsArrs.length === 0) { | ||
// ofer to run it when the user doesnt have any scripts setup! 🤯 | ||
possibleArgsArrs.push(['expo', 'start', '--web']) | ||
} | ||
return { | ||
type: 'expo', | ||
command: getYarnOrNPMCommand(), | ||
port: 8888, | ||
proxyPort: 19006, | ||
env: { ...process.env }, | ||
possibleArgsArrs, | ||
urlRegexp: new RegExp(`(http://)([^:]+:)${19006}(/)?`, 'g'), | ||
dist: 'web-build' | ||
} | ||
} |