mirror of
https://github.com/zhigang1992/esbuild.git
synced 2026-04-29 18:06:15 +08:00
add "--sources-content=false" (#624)
This commit is contained in:
@@ -141,6 +141,23 @@ func parseOptionsImpl(osArgs []string, buildOpts *api.BuildOptions, transformOpt
|
||||
}
|
||||
hasBareSourceMapFlag = false
|
||||
|
||||
case strings.HasPrefix(arg, "--sources-content="):
|
||||
value := arg[len("--sources-content="):]
|
||||
var sourcesContent api.SourcesContent
|
||||
switch value {
|
||||
case "false":
|
||||
sourcesContent = api.SourcesContentExclude
|
||||
case "true":
|
||||
sourcesContent = api.SourcesContentInclude
|
||||
default:
|
||||
return fmt.Errorf("Invalid sources content: %q (valid: false, true)", value)
|
||||
}
|
||||
if buildOpts != nil {
|
||||
buildOpts.SourcesContent = sourcesContent
|
||||
} else {
|
||||
transformOpts.SourcesContent = sourcesContent
|
||||
}
|
||||
|
||||
case strings.HasPrefix(arg, "--sourcefile="):
|
||||
if buildOpts != nil {
|
||||
if buildOpts.Stdin == nil {
|
||||
|
||||
Reference in New Issue
Block a user