Skip to content

Commit 667beee

Browse files
committed
fix: add preview as a start script for node runtimes
1 parent 1266db7 commit 667beee

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Detected in order of precedence:
143143
#### Start Command
144144

145145
Detected in order of precedence:
146-
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "start"`
146+
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"`
147147
- `package.json` main/module file: `bun run ${mainFile}`
148148

149149
---
@@ -179,7 +179,7 @@ Detected in order of precedence:
179179
#### Start Command
180180

181181
Detected in order of precedence:
182-
- `deno.jsonc` tasks: `"serve", "start:prod", "start:production", "start-prod", "start-production", "start"`
182+
- `deno.jsonc` tasks: `"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"`
183183
- Main/module file: `deno run ["mod.ts", "src/mod.ts", "main.ts", "src/main.ts", "index.ts", "src/index.ts]"`
184184

185185
---
@@ -361,7 +361,7 @@ In order of precedence:
361361

362362
#### Start Command
363363
In order of precedence:
364-
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "start"`
364+
- `package.json` scripts: `"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"`
365365
- `package.json` scripts search for regex matching: `^.*?\b(ts-)?node(mon)?\b.*?(index|main|server|client)\.([cm]?[tj]s)\b`
366366
- `package.json` main/module file: `node ${mainFile}`
367367

runtime/bun.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (d *Bun) GenerateDockerfile(path string) ([]byte, error) {
6767
if ok {
6868
d.Log.Info("Detected scripts in package.json")
6969

70-
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "start"}
70+
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"}
7171
for _, cmd := range startCommands {
7272
if _, ok := scripts[cmd].(string); ok {
7373
d.Log.Info("Detected start command in package.json: " + cmd)

runtime/deno.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func (d *Deno) GenerateDockerfile(path string) ([]byte, error) {
9999

100100
scripts, ok := denoJSON["tasks"].(map[string]interface{})
101101
if ok {
102-
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "start"}
102+
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"}
103103
for _, cmd := range startCommands {
104104
if _, ok := scripts[cmd].(string); ok {
105105
d.Log.Info("Detected start command in deno.json: " + cmd)

runtime/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (d *Node) GenerateDockerfile(path string) ([]byte, error) {
8686

8787
if ok {
8888
d.Log.Info("Detected scripts in package.json")
89-
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "start"}
89+
startCommands := []string{"serve", "start:prod", "start:production", "start-prod", "start-production", "preview", "start"}
9090
for _, cmd := range startCommands {
9191
if _, ok := scripts[cmd].(string); ok {
9292
startCMD = fmt.Sprintf("%s run %s", packageManager, cmd)

0 commit comments

Comments
 (0)