zh/posts/frontend-in-go-modules #63
Replies: 1 comment 1 reply
-
前后端联动的项目可以使用go work来管理 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
zh/posts/frontend-in-go-modules
使用Go Modules引入前端产物到Go项目 能够编译成一个单独的二进制文件是Go语言的一大特色,避免了部署时繁琐的依赖管理。然而,如果项目包含了前端代码,在编译的时候就需要想办法将前端产物嵌入到Go二进制文件中。编译流程大致如下: 编译前端代码。 将前端生成物转换为Go嵌入文件。例如,rakyll/statik这个项目就能够将任何文件嵌入到Go源代码中。另外,Go语言目前提供了官方资源嵌入方案embed,可以在编译期间完成嵌入,免去步骤2。 构建Go代码。
https://gorse.io/zh/posts/frontend-in-go-modules.html
Beta Was this translation helpful? Give feedback.
All reactions