diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-01-21 18:52:32 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-01-22 11:03:24 +0300 |
commit | e19a046c4be9b0654884259b9df94f41561e4fc3 (patch) | |
tree | 391c53358df72b346fbccf57a01dca2eb316da7d /hugolib | |
parent | a1fe552fc9e622a15010a94281f604eb85bebd84 (diff) |
js: Add Shims option
This commit adds a new `shims` option to `js.Build` that allows swapping out a component with another.
Fixes #8165
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/js_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hugolib/js_test.go b/hugolib/js_test.go index 145a057c1..8ab0b970c 100644 --- a/hugolib/js_test.go +++ b/hugolib/js_test.go @@ -187,7 +187,7 @@ path="github.com/gohugoio/hugoTestProjectJSModImports" go 1.15 -require github.com/gohugoio/hugoTestProjectJSModImports v0.5.0 // indirect +require github.com/gohugoio/hugoTestProjectJSModImports v0.8.0 // indirect `) @@ -215,4 +215,9 @@ Hello3 from mod2. Date from date-fns: ${today} Hello from lib in the main project Hello5 from mod2. var myparam = "Hugo Rocks!";`) + + // React JSX, verify the shimming. + b.AssertFileContent("public/js/like.js", `@v0.8.0/assets/js/shims/react.js +module.exports = window.ReactDOM; +`) } |