An example project using Go standard library templates with a modern Webpack asset pipeline.
- Webpack Asset Pipeline
- Bundled assets
- Hashed filenames for easy caching.
- Go standard library templates
- Simple, familiar template language
- Template function to retrieve hashed filenames from the webpack manifest
- Frontend
- Bootstrap 4
- JQuery
- Chi router
- Idiomatic router (can be easily removed if you prefer)
- Asset caching middleware
- Builds into single binary with Packr (assets included)
- Go 1.8+
- github.com/go-chi/chi
- github.com/gobuffalo/packr
- Node 8.11.1+
- Yarn (or npm if you prefer)
All yarn commands can be replaced with npm if you prefer
Install dependencies
go get -d ./...
yarn install --dev
Build
yarn build (or yarn dev)
packr build
Run
./go-template-asset-pipeline.exe
Running on localhost:3000