Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 571 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 571 Bytes

gs

gopherjs related tools

Handler is a tool to serve gopherjs at real time best for developer mode

go server

gstool "github.com/kelwang/gs/tool"

... ...

if c.DevMode() {
    gsOpts := &gbuild.Options{CreateMapFile: false}
    mux.Handle("/gs-src/", gstool.Handler("github.com/xxx/mygopherjs/", gsOpts, len("gs-src/")))
}else{
    // serve compiled javascript
    mux.Handle("/js/script/script.js", aStaticHandler)
}

html

   <script src="/gs-src/script/script.js"></script> 

gopherjs folder

/mygopherjs
--/script/main.go