Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB-48738: add initial esbuild script
Change-Id: I5bd90857f53ed6253d2608dd5e60ba5c76322530 Reviewed-on: http://review.couchbase.org/c/ns_server/+/163992 Well-Formed: Build Bot <build@couchbase.com> Tested-by: Pavel Blagodov <stochmail@gmail.com> Reviewed-by: Chris Hillery <ceej@couchbase.com>
- Loading branch information
1 parent
e9c2099
commit 620b300
Showing
5 changed files
with
90 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// @author Couchbase <info@couchbase.com> | ||
// @copyright 2016-Present Couchbase, Inc. | ||
// | ||
// Use of this software is governed by the Business Source License included | ||
// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
// in that file, in accordance with the Business Source License, use of this | ||
// software will be governed by the Apache License, Version 2.0, included in | ||
// the file licenses/APL2.txt. | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"os" | ||
"log" | ||
"github.com/evanw/esbuild/pkg/api" | ||
) | ||
|
||
func main() { | ||
inDir := flag.String("in-dir", "", "path to js source dir (required)") | ||
outDir := flag.String("out-dir", "", "path to js output dir (required)") | ||
flag.Parse() | ||
log.SetFlags(0) | ||
|
||
if *inDir == "" { | ||
log.Printf("Error: path to js source dir must be specified\n") | ||
flag.Usage() | ||
os.Exit(1) | ||
} | ||
|
||
if *outDir == "" { | ||
log.Printf("Error: path to js source dir must be specified\n") | ||
flag.Usage() | ||
os.Exit(1) | ||
} | ||
|
||
result := api.Build(api.BuildOptions{ | ||
// MinifyWhitespace: true, | ||
// // MinifyIdentifiers: true, | ||
// MinifySyntax: true, | ||
KeepNames: true, | ||
|
||
AbsWorkingDir: *inDir + "/app", | ||
Outdir: *outDir, | ||
|
||
NodePaths: []string{ | ||
*inDir + "/web_modules", | ||
*inDir + "/libs", | ||
*inDir + "/app", | ||
}, | ||
EntryPoints: []string{ | ||
"main.js", | ||
}, | ||
Bundle: true, | ||
Splitting: true, | ||
Write: true, | ||
Metafile: true, | ||
Format: api.FormatESModule, | ||
LogLevel: api.LogLevelInfo, | ||
Engines: []api.Engine{ | ||
{api.EngineChrome, "93"}, | ||
{api.EngineFirefox, "92"}, | ||
{api.EngineSafari, "14"}, | ||
{api.EngineEdge, "93"}, | ||
}, | ||
}) | ||
|
||
if len(result.Errors) > 0 { | ||
os.Exit(1) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/couchbase/ns_server | ||
|
||
go 1.17 | ||
|
||
require github.com/evanw/esbuild v0.12.27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
github.com/evanw/esbuild v0.12.27 h1:pWtTIKGO4Af2P2u6Jps5vmJy1wpUqdx4QmI1Y/fvxY8= | ||
github.com/evanw/esbuild v0.12.27/go.mod h1:GG+zjdi59yh3ehDn4ZWfPcATxjPDUH53iU4ZJbp7dkY= | ||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= | ||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | ||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= | ||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365 h1:6wSTsvPddg9gc/mVEEyk9oOAoxn+bT4Z9q1zx+4RwA4= | ||
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | ||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= | ||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= |