js.Build: Generate tsconfig files

Updates #7777

Added support to allow SourceMap files to be external to the build.
In addition added more information when the js compilation has an error.
Correctly append sourceMappingURL to output file.
Fix merge conflict.
This commit is contained in:
Andreas Richter
2020-09-12 00:19:36 -04:00
committed by Bjørn Erik Pedersen
parent e10e36cf70
commit 3089fc0ba1
4 changed files with 674 additions and 24 deletions

View File

@@ -77,4 +77,20 @@ func TestToBuildOptions(t *testing.T) {
Sourcemap: api.SourceMapInline,
Stdin: &api.StdinOptions{},
})
opts, err = toBuildOptions(Options{
Target: "es2018", Format: "cjs", Minify: true, mediaType: media.JavascriptType,
SourceMap: "external"})
c.Assert(err, qt.IsNil)
c.Assert(opts, qt.DeepEquals, api.BuildOptions{
Bundle: true,
Target: api.ES2018,
Format: api.FormatCommonJS,
MinifyIdentifiers: true,
MinifySyntax: true,
MinifyWhitespace: true,
Sourcemap: api.SourceMapExternal,
Stdin: &api.StdinOptions{},
})
}