Skip to content

Commit

Permalink
Explicitly set publicPath for production webpack configuration
Browse files Browse the repository at this point in the history
`django-webpack-loader` defers to `publicPath` if it is available when
creating `<script>` tags, and otherwise constructs the path using the
bundle name and the value of the `BUNDLE_DIR_NAME` setting.

In practice, I was unable to find a value for `BUNDLE_DIR_NAME` that worked
for both locating the bundles on the local filesystem and creating URLs.

Setting `publicPath` explicitly (as we already do for development) works
around the issue.
  • Loading branch information
maurizi committed Jul 11, 2016
1 parent f9301f4 commit 6659b13
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webpack.prod.config.js
Expand Up @@ -25,4 +25,6 @@ config.plugins.concat([
new webpack.optimize.OccurrenceOrderPlugin()
]);

config.output.publicPath = '/static/';

module.exports = config;

0 comments on commit 6659b13

Please sign in to comment.