summaryrefslogtreecommitdiffhomepage
path: root/resources/resource_transformers/js/build_test.go
diff options
context:
space:
mode:
authorAndreas Richter <[email protected]>2020-09-12 00:19:36 -0400
committerBjørn Erik Pedersen <[email protected]>2020-11-03 13:04:37 +0100
commit3089fc0ba171be14670b19439bc2eab6b077b6c3 (patch)
tree536bda18455c79bea9310406577c1de8f0a54197 /resources/resource_transformers/js/build_test.go
parente10e36cf70b8962b3b2a721603ba844022652d20 (diff)
downloadhugo-3089fc0ba171be14670b19439bc2eab6b077b6c3.tar.gz
hugo-3089fc0ba171be14670b19439bc2eab6b077b6c3.zip
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.
Diffstat (limited to 'resources/resource_transformers/js/build_test.go')
-rw-r--r--resources/resource_transformers/js/build_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/resources/resource_transformers/js/build_test.go b/resources/resource_transformers/js/build_test.go
index c04c0ed12..8839c646e 100644
--- a/resources/resource_transformers/js/build_test.go
+++ b/resources/resource_transformers/js/build_test.go
@@ -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{},
+ })
+
}