mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
js: Add Shims option
This commit adds a new `shims` option to `js.Build` that allows swapping out a component with another. Fixes #8165
This commit is contained in:
@@ -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;
|
||||
`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user