resources: Add JavaScript transpiling solution

Add a new pipe called TranspileJS which uses the Babel cli. This makes it possible for users to write ES6 JavaScript code and transpile it to ES5 during website generation so that the code still works with older browser versions.

Fixes #5764
This commit is contained in:
Niek de Wit
2019-03-22 17:07:37 +01:00
committed by Bjørn Erik Pedersen
parent 67f920419a
commit 2a171ff1c5
5 changed files with 308 additions and 16 deletions

View File

@@ -60,6 +60,11 @@ func init() {
[][2]string{},
)
ns.AddMethodMapping(ctx.TranspileJS,
[]string{"transpileJS"},
[][2]string{},
)
return ns
}