Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-01-21 18:52:32 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-01-22 11:03:24 +0300
commite19a046c4be9b0654884259b9df94f41561e4fc3 (patch)
tree391c53358df72b346fbccf57a01dca2eb316da7d /hugolib
parenta1fe552fc9e622a15010a94281f604eb85bebd84 (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.go7
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;
+`)
}