1 | const { hasRequiredDeps, hasRequiredFiles, getYarnOrNPMCommand, scanScripts } = require('./utils/jsdetect')
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | module.exports = function() {
|
7 |
|
8 | if (!hasRequiredFiles(['package.json', 'stencil.config.ts'])) return false
|
9 |
|
10 | if (!hasRequiredDeps(['@stencil/core'])) return false
|
11 |
|
12 |
|
13 |
|
14 | const possibleArgsArrs = scanScripts({
|
15 | preferredScriptsArr: ['start'],
|
16 | preferredCommand: 'stencil build --dev --watch --serve'
|
17 | })
|
18 |
|
19 | return {
|
20 | type: 'stencil',
|
21 | command: getYarnOrNPMCommand(),
|
22 | port: 8888,
|
23 | proxyPort: 3333,
|
24 | env: { ...process.env, BROWSER: 'none', PORT: 3000 },
|
25 | possibleArgsArrs,
|
26 | urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'),
|
27 | dist: 'www'
|
28 | }
|
29 | }
|