1 | const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect')
|
2 | module.exports = function() {
|
3 |
|
4 | if (!hasRequiredFiles(['package.json', 'siteConfig.js'])) return false
|
5 |
|
6 | if (!hasRequiredDeps(['docusaurus'])) return false
|
7 |
|
8 |
|
9 |
|
10 | const possibleArgsArrs = scanScripts({
|
11 | preferredScriptsArr: ['start'],
|
12 | preferredCommand: 'docusaurus-start'
|
13 | })
|
14 |
|
15 | return {
|
16 | type: 'docusaurus',
|
17 | command: getYarnOrNPMCommand(),
|
18 | port: 8888,
|
19 | proxyPort: 3000,
|
20 | env: { ...process.env },
|
21 | possibleArgsArrs,
|
22 | urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'),
|
23 | dist: 'static'
|
24 | }
|
25 | }
|