Skip to content

Commit

Permalink
export: fix server to serve assets as root
Browse files Browse the repository at this point in the history
  • Loading branch information
progrium committed Apr 2, 2024
1 parent 011c581 commit ceb5bb3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/export/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"embed"
"fmt"
"io"
"io/fs"
"net/http"
"path/filepath"

Expand All @@ -25,7 +26,11 @@ func main() {
if _, ok := ext[filepath.Ext(r.URL.Path)]; ok {
w.Header().Set("content-type", "text/javascript")
}
xfs := xformfs.New(assets)
dir, err := fs.Sub(assets, "assets")
if err != nil {
panic(err)
}
xfs := xformfs.New(dir)
xfs.Transform(".jsx", transformJSX)
xfs.Transform(".tsx", transformTSX)
xfs.Transform(".ts", transformTSX)
Expand Down

0 comments on commit ceb5bb3

Please sign in to comment.