{"id":40276840,"url":"https://github.com/go-webpack/webpack","last_synced_at":"2026-01-20T03:08:26.412Z","repository":{"id":57492096,"uuid":"84140637","full_name":"go-webpack/webpack","owner":"go-webpack","description":"Serve webpack assets properly from golang frameworks","archived":false,"fork":false,"pushed_at":"2019-11-23T08:33:55.000Z","size":123,"stargazers_count":106,"open_issues_count":0,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-01-15T05:26:31.155Z","etag":null,"topics":["golang","integration","webpack","webpack4"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-webpack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-07T01:40:29.000Z","updated_at":"2024-09-04T02:00:23.000Z","dependencies_parsed_at":"2022-08-28T13:31:30.977Z","dependency_job_id":null,"html_url":"https://github.com/go-webpack/webpack","commit_stats":null,"previous_names":["go-webpack/go-webpack"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/go-webpack/webpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-webpack%2Fwebpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-webpack%2Fwebpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-webpack%2Fwebpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-webpack%2Fwebpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-webpack","download_url":"https://codeload.github.com/go-webpack/webpack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-webpack%2Fwebpack/sbom","scorecard":{"id":432643,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-webpack/webpack","commit":"d429806e086ae8df292f98da021e33f390440788"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/25 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:43:27.203Z","repository_id":57492096,"created_at":"2025-08-19T03:43:27.203Z","updated_at":"2025-08-19T03:43:27.203Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28594958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","integration","webpack","webpack4"],"created_at":"2026-01-20T03:08:25.820Z","updated_at":"2026-01-20T03:08:26.402Z","avatar_url":"https://github.com/go-webpack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## go-webpack\n\n[![GoDoc](https://godoc.org/github.com/go-webpack/webpack?status.svg)](https://godoc.org/github.com/go-webpack/webpack)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-webpack/webpack)](https://goreportcard.com/report/github.com/go-webpack/webpack)\n[![Maintainability](https://api.codeclimate.com/v1/badges/93067e957c189653e7a3/maintainability)](https://codeclimate.com/github/go-webpack/webpack/maintainability)\n[![Build Status](https://travis-ci.com/go-webpack/webpack.svg?branch=master)](https://travis-ci.com/go-webpack/webpack)\n\nThis module allows proper integration with webpack, with support for proper assets reloading in development and asset hashes for production caching.\n\nThis module is compatible with webpack 1.0 to 4.0\n\nFor webpack 4 use this example config file:\nhttps://github.com/go-webpack/examples/blob/master/config/webpack.config.js\n(the only thing required for go-webpack is ManifestPlugin - the rest is my personal example config)\n\n## Examples\n\nAre [here](https://github.com/go-webpack/examples)\n\n## Changelog\n\n#### Unreleased\n\n#### Version 2.0.0\n- Switch to go 1.11 modules\n- Various refactoring\n- Change default to stats plugin, to use StatsPlugin set it manually ```webpack.Plugin = \"stats\"```\n- Update examples, add pongo2, gin and gin-render examples\n\n#### Version 1.4.2\n- Don't fail if manifest is not present in development mode\n\n#### Version 1.4.1\n- less noisy (remove some logs on verbose)\n\n#### Version 1.4.0\n\n- 2018-11-10 Fix globals usage and add some tests #4 thx @toshok\n- 2018-11-10 tweak iris example #3 thx @vosmith\n- assorted refactoring\n\n#### Version 1.3.0\n\n- 2018-09-12 Add ability to use multiple webpack manifests per app\n\n#### Version 1.2\n\n- 2018-07-17 Don't hardcode manifest path (thx @rodumani)\n- 2018-07-17 Deprecate stats plugin default, specify plugin explicitly to continue using it.\n- 2018-07-17 Pretty print manifest content\n\n#### Version 1.1\n\n- 2018-02-13 Move examples to [separate repo](https://github.com/go-webpack/examples)\n- 2018-02-09 Refactor \u0026 cleanup code, add support for ManifestPlugin instead of outdated StatsPlugin (see new examples)\n- 2017-08-09 Now reports if you didn't call webpack.Init() to set working mode properly\n\n#### Version 1.0\n\n- 2017-03-07 Initial version / extraction\n\n#### Usage with QOR / Gin\n##### main.go\n```golang\nimport (\n  ...\n  \"github.com/go-webpack/webpack\"\n)\nfunc main() {\n  is_dev := flag.Bool(\"dev\", false, \"development mode\")\n  flag.Parse()\n  webpack.DevHost = \"localhost:3808\" // default\n  webpack.Plugin = \"manifest\" // defaults to stats for compatability\n  // webpack.IgnoreMissing = true // ignore assets not present in manifest\n  webpack.Init(*is_dev)\n  ...\n}\n```\n\n##### controller.go (qor)\n```golang\npackage controllers\n\nimport (\n  \"github.com/qor/render\"\n  \"github.com/gin-gonic/gin\"\n  \"github.com/go-webpack/webpack\"\n)\n\nvar Render *render.Render\n\nfunc init() {\n  Render = render.New()\n}\n\nfunc ViewHelpers() map[string]interface{} {\n  return map[string]interface{}{\"asset\": webpack.AssetHelper}\n}\n\nfunc HomeIndex(ctx *gin.Context) {\n  Render.Funcs(ViewHelpers()).Execute(\n    \"home_index\",\n    gin.H{},\n    ctx.Request,\n    ctx.Writer,\n  )\n}\n```\n\n##### alternate controller/route (gin / eztemplate)\n\n```golang\nimport (\n  \"github.com/gin-gonic/gin\"\n  eztemplate \"github.com/michelloworld/ez-gin-template\"\n)\nr = gin.Default()\nrender := eztemplate.New()\nrender.TemplateFuncMap = template.FuncMap{\n  \"asset\": webpack.AssetHelper,\n}\nr.HTMLRender = render.Init()\n```\n\n##### layouts/application.tmpl\n\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /\u003e\n    {{ asset \"vendor.css\" }}\n    {{ asset \"application.css\" }}\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv class=\"page-wrap\"\u003e\n      {{render .Template}}\n    \u003c/div\u003e\n    {{ asset \"vendor.js\" }}\n    {{ asset \"application.js\" }}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Usage with Iris\n\n##### main.go\n\n```golang\nimport (\n  \"flag\"\n  \"github.com/go-webpack/webpack\"\n  iris \"gopkg.in/kataras/iris.v6\"\n  \"gopkg.in/kataras/iris.v6/adaptors/httprouter\"\n  \"gopkg.in/kataras/iris.v6/adaptors/view\"\n)\n\nfunc main() {\n  is_dev := flag.Bool(\"dev\", false, \"development mode\")\n  flag.Parse()\n  webpack.Plugin = \"manifest\"\n  webpack.Init(*is_dev)\n  view := view.HTML(\"./templates\", \".html\")\n  view = view.Layout(\"layout.html\")\n  view = view.Funcs(map[string]interface{}{\"asset\": webpack.AssetHelper})\n  app := iris.New()\n  app.Adapt(view.Reload(*is_dev))\n\n  app.Adapt(httprouter.New())\n\n  ...\n\n}\n```\n\n##### templates/layout.html\n```html\n\u003c!DOCTYPE HTML\u003e\n\u003chtml lang=\"en\" \u003e\n\u003chead\u003e\n\u003cmeta charset=\"UTF-8\"\u003e\n\u003ctitle\u003e\u003c/title\u003e\n{{ asset \"vendor.css\" }}\n{{ asset \"application.css\" }}\n\u003c/head\u003e\n\u003cbody\u003e\n{{ yield }}\n{{ asset \"vendor.js\" }}\n{{ asset \"application.js\" }}\n```\n\n#### Using multiple webpack manifests per app\n\nAlternative usage if you need multiple webpack manifests (if you have separate js apps with separate webpack configs for separate portions of your app for example)\n\nfor qor/render, other would be similar\n\n```\n\tLandingRender = render.New(\u0026render.Config{\n\t\tViewPaths:     []string{\"app/views\"},\n\t\tDefaultLayout: \"landing\",\n\t\tFuncMapMaker: func(*render.Render, *http.Request, http.ResponseWriter) template.FuncMap {\n\t\t\treturn template.FuncMap{\n\t\t\t\t\"asset\": webpack.GetAssetHelper(webpack.BasicConfig(\n\t\t\t\t\t\"localhost:7420\", // dev server\n\t\t\t\t\t\"./public/landing\", // file path\n\t\t\t\t\t\"landing\", // web path\n\t\t\t\t)),\n\t\t\t\t//\"json\":  json.Marshal,\n\t\t\t}\n\t\t},\n\t})\n```\n\n#### Usage with other frameworks\n\n- Configure webpack to serve manifest.json via ~~StatsPlugin~~ ManifestPlugin\n- Call ```webpack.Plugin = \"manifest\"``` to set go-webpack to use ManifestPlugin, don't call to use old StatsPlugin\n- Call ```webpack.Init()``` to set development or production mode.\n- Add webpack.AssetHelper to your template functions.\n- Call helper function with the name of your asset\n\nUse webpack.config.js (and package.json) from this repo or create your own.\n\nThe only thing that must be present in your webpack config is ~~StatsPlugin~~ ManifestPlugin which is required to serve assets the proper way with hashes, etc.\n\nYour compiled assets is expected to be at public/webpack and your webpack-dev-server at http://localhost:3808\n\nWhen run with -dev flag, webpack asset manifest is loaded from http://localhost:3808/webpack/manifest.json, and updated automatically on every request. When running in production from public/webpack/manifest.json and is persistently cached in memory for performance reasons.\n\n#### Running examples\n\nExamples moved to separate repo [here](https://github.com/go-webpack/examples)\n\n```\ncd examples\nyarn install # or npm install\n# for development mode\nyarn start\n# or ./node_modules/.bin/webpack-dev-server --config webpack.config.js --hot --inline\n\n# Or for production mode\nyarn build\n# or ./node_modules/.bin/webpack --config webpack.config.js --bail\n\n# start backend\ngo get\ngo run iris/main.go -dev\ngo run qor/main.go -dev\n```\n\nIf all is working, you will see a JS alert message.\n\n#### Compiling assets for production\n\n```\nNODE_ENV=production ./node_modules/.bin/webpack --config webpack.config.js\n```\nDon't forget to set go-webpack to production mode (webpack.Init(false))\n\n#### Additional settings\n\nvar DevHost = \"localhost:3808\" - webpack-dev-server host:port\nvar FsPath = \"public/webpack\" - filesystem path to public webpack dir\nvar WebPath = \"webpack\" - http path to public webpack dir\nvar Plugin = \"stats\" - webpack plugin to use, can be stats or manifest\nvar IgnoreMissing = true - ignore assets missing on manifest or fail on them\nvar Verbose = true - print error messages to console (even if error is ignored)\n\n#### License\n\nCopyright (c) 2017 glebtv\n\nMIT License\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-webpack%2Fwebpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-webpack%2Fwebpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-webpack%2Fwebpack/lists"}