mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
- Migrate module path to github.com/hanzoai/pack across all Go packages - Remove legacy upstream docs and competitor brand references - Modernize LLM.md and mise.toml for pristine Hanzo Pack builder
24 lines
589 B
Go
24 lines
589 B
Go
package node
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/hanzoai/pack/core/generate"
|
|
)
|
|
|
|
const (
|
|
DefaultCRAOutputDirectory = "build"
|
|
DefaultCRAStartCommand = "react-scripts start"
|
|
)
|
|
|
|
func (p *NodeProvider) isCRA(ctx *generate.GenerateContext) bool {
|
|
hasReactScriptsDep := p.hasDependency("react-scripts")
|
|
hasCRABuildCommand := strings.Contains(strings.ToLower(p.packageJson.GetScript("build")), "react-scripts build")
|
|
|
|
return hasReactScriptsDep && hasCRABuildCommand
|
|
}
|
|
|
|
func (p *NodeProvider) getCRAOutputDirectory(ctx *generate.GenerateContext) string {
|
|
return DefaultCRAOutputDirectory
|
|
}
|