Skip to content

Commit

Permalink
Merge pull request #218 from rebuy-de/tweak-migraiton
Browse files Browse the repository at this point in the history
improve migration M0002
  • Loading branch information
svenwltr authored Nov 8, 2024
2 parents 7d1b5ea + 7c50567 commit 2aee19c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,23 @@ package web
import (
"embed"
"io/fs"
"os"

"github.com/rebuy-de/rebuy-go-sdk/v8/pkg/webutil"
)

//go:generate yarn install
//go:generate yarn build

//go:embed all:dist/*
var Dist embed.FS
var embedded embed.FS

func FS() fs.FS {
result, err := fs.Sub(Dist, "dist")
func DevFS() webutil.AssetFS {
return os.DirFS("web/dist")
}

func ProdFS() webutil.AssetFS {
result, err := fs.Sub(embedded, "dist")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -368,8 +375,8 @@ This should run without errors and generate the directories `web/dist` and `web/

#### 6. Update directory references

* use `web.FS()` instead of `//go:embed`
* use `os.DirFS("web/dist")` instead of `os.DirFS("cmd/assets")` in dev command
* use `web.ProdFS()` instead of `//go:embed`
* use `web.DevFS()` instead of `os.DirFS("cmd/assets")` in dev command

#### 7. Configure Dependabot

Expand Down

0 comments on commit 2aee19c

Please sign in to comment.