https://github.com/vanng822/webpackstats
Generate url based on bundle tracker stats
https://github.com/vanng822/webpackstats
Last synced: over 1 year ago
JSON representation
Generate url based on bundle tracker stats
- Host: GitHub
- URL: https://github.com/vanng822/webpackstats
- Owner: vanng822
- License: mit
- Created: 2016-08-03T21:10:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-04T14:12:59.000Z (about 2 years ago)
- Last Synced: 2025-01-18T05:27:39.415Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webpackstats
For rendering the bundle url generated by webpack based on metadata generated by https://github.com/owais/webpack-bundle-tracker
# Usage
```go
templates := template.New("")
templates = templates.Funcs(webpackstats.WebpackURLFuncMap("/path/to/stats.json"))
templates = template.Must(templates.ParseGlob("templates/*"))
```
Bundle with single chunk
```html
```
Loop through chunks of the bundle
```html
{{- range $bundleUrl := webpackUrls "bundle" }}
{{- end }}
```
Generate scripts for all chunks of the bundle
```html
{{webpackScripts "bundle"}}
```