https://github.com/ugent-library/mix
Package mix implements convenience methods to integrate the Laravel Mix asset bundler in your Go project.
https://github.com/ugent-library/mix
go webpack
Last synced: about 2 months ago
JSON representation
Package mix implements convenience methods to integrate the Laravel Mix asset bundler in your Go project.
- Host: GitHub
- URL: https://github.com/ugent-library/mix
- Owner: ugent-library
- License: apache-2.0
- Archived: true
- Created: 2023-01-23T08:26:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T15:27:41.000Z (over 3 years ago)
- Last Synced: 2025-10-31T02:14:09.705Z (8 months ago)
- Topics: go, webpack
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/ugent-library/mix)
# ugent-library/mix
Package mix implements convenience methods to integrate the Laravel Mix
asset bundler in your Go project.
For more information on Laravel Mix, visit the [Laravel Mix](https://laravel-mix.com/) website.
## Install
```sh
go get -u github.com/ugent-library/mix
```
## Example
Setup your `webpack.mix.js`:
```js
const mix = require('laravel-mix')
mix.sass('./assets/css/app.scss', 'css')
mix.setPublicPath('./static')
// ...
```
And in your Go app:
```go
// setup file server
mux := http.NewServeMux()
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static"))))
// setup assets
assets, err := mix.New(mix.Config{
ManifestFile: "static/mix-manifest.json",
PublicPath: "/static/",
})
if err != nil {
log.Fatal(err)
}
// make asset path helper available to templates
funcs := template.FuncMap{
"assetPath": assets.AssetPath,
}
// ...
```