mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
js.Build: Add SourceMap flag with inline option
Added a flag to allow turning on sourcemap in ESBuild. The current support can only support inline or true as value for sourcemap. This is because the way ESBuild is invoked it doesn't have a separate output path to write the mapfile external to the asset pipeline. Add disable for "" and "0". Add test script and make sure mage check passes. Fixes #7607
This commit is contained in:
@@ -63,4 +63,18 @@ func TestToBuildOptions(t *testing.T) {
|
||||
Stdin: &api.StdinOptions{},
|
||||
})
|
||||
|
||||
opts, err = toBuildOptions(Options{
|
||||
Target: "es2018", Format: "cjs", Minify: true, mediaType: media.JavascriptType,
|
||||
SourceMap: "inline"})
|
||||
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.SourceMapInline,
|
||||
Stdin: &api.StdinOptions{},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user