Rename transpileJS to babel

And add a test.

Updates #5764
This commit is contained in:
Bjørn Erik Pedersen
2020-04-28 14:02:41 +02:00
parent 2a171ff1c5
commit 6add6d77b4
8 changed files with 233 additions and 119 deletions

View File

@@ -25,9 +25,9 @@ import (
"strconv"
"strings"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/resources/internal"
"github.com/spf13/afero"
@@ -202,10 +202,7 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC
cmd.Stdout = ctx.To
cmd.Stderr = io.MultiWriter(os.Stderr, &errBuf)
// TODO(bep) somehow generalize this to other external helpers that may need this.
env := os.Environ()
config.SetEnvVars(&env, "HUGO_ENVIRONMENT", t.rs.Cfg.GetString("environment"))
cmd.Env = env
cmd.Env = hugo.GetExecEnviron(t.rs.Cfg)
stdin, err := cmd.StdinPipe()
if err != nil {