Skip to content

Instantly share code, notes, and snippets.

@SBoudrias
Created October 9, 2015 18:42
Show Gist options
  • Save SBoudrias/a2931f39ccabcc397adc to your computer and use it in GitHub Desktop.
Save SBoudrias/a2931f39ccabcc397adc to your computer and use it in GitHub Desktop.

So the issue with this setting is that when the initial bundle load, it cannot load future bundles.

Initial bundle comes from http://dev.local/m/bundles/foo-74b26207487b44f00927.js.

Then it tries to load the another bundle: http://dev.local/1.1-74b26207487b44f00927.js.

It looks like the webpack publicPath is messed up.

STATIC_URL = '/m/'
STATICFILES_DIRS = (
abspath(os.path.join(PROJECT_ROOT, '../dist')),
abspath(os.path.join(PROJECT_ROOT, '../www')),
)
WEBPACK_LOADER = {
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(PROJECT_ROOT, '../webpack-stats.json'),
'POLL_DELAY': 0.1,
},
}
{% render_bundle 'foo' %}
var path = require('path')
var webpack = require('webpack')
var BundleTracker = require('webpack-bundle-tracker')
module.exports = {
context: __dirname,
entry: {
foo: 'foo/main',
bar: 'bar/main',
},
output: {
path: path.resolve('./dist/bundles/'),
filename: '[name]-[hash].js',
},
plugins: [
new BundleTracker({filename: 'webpack-stats.json'}),
],
}
@owais
Copy link

owais commented Oct 9, 2015

Not sure why this would happen. Where does the name 1.1- even come from?

Try setting publicPath to http://dev.local/m/ in output and see if that works.

@owais
Copy link

owais commented Oct 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment