resources: Add basic @import support to resources.PostCSS

This commit also makes the HUGO_ENVIRONMENT environment variable available to Node.

Fixes #6957
Fixes #6961
This commit is contained in:
Bjørn Erik Pedersen
2020-02-26 10:06:04 +01:00
parent 05a74eaec0
commit b66d38c419
5 changed files with 313 additions and 1 deletions

View File

@@ -1039,3 +1039,18 @@ func skipSymlink(t *testing.T) {
}
}
func captureStderr(f func() error) (string, error) {
old := os.Stderr
r, w, _ := os.Pipe()
os.Stderr = w
err := f()
w.Close()
os.Stderr = old
var buf bytes.Buffer
io.Copy(&buf, r)
return buf.String(), err
}