Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Fix assets helpers
Browse files Browse the repository at this point in the history
* Fix #921: use webpack publicPath, instead of hard-coded "/assets/".
  • Loading branch information
stanislas-m committed Apr 14, 2018
1 parent e8adcbf commit b5ea198
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion generators/assets/webpack/templates/webpack.config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const configurator = {
var config = {
mode: env,
entry: configurator.entries(),
output: {filename: "[name].[hash].js", path: `${__dirname}/public/assets`},
output: {filename: "[name].[hash].js", path: `${__dirname}/public/assets`, publicPath: "/assets/"},
plugins: configurator.plugins(),
module: configurator.moduleOptions()
}
Expand Down
4 changes: 2 additions & 2 deletions render/template_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func assetPathFor(file string) string {

filePath := assetMap[file]
if filePath == "" {
filePath = file
filePath = filepath.Join("/assets", file)
}
return filepath.ToSlash(filepath.Join("/assets", filePath))
return filepath.ToSlash(filePath)
}

type helperTag struct {
Expand Down

0 comments on commit b5ea198

Please sign in to comment.