Skip to content

Issue with latest BundleTracker JSON file format #238

@barbusina

Description

@barbusina

django-webpack-loader doesn't work with latest BundleTracker webpack plugin version 1.0.0-alpha.1

The reason in changed BundleTracker's JSON file format.

I have fixed it by changing loader.py line 83:

-return self.filter_chunks(chunks)
+return self.filter_chunks(list(map(assets['assets'].get, chunks)))

or we can add this construction for backward compatibility:
+if 'assets' in assets:
+ return self.filter_chunks(list(map(assets['assets'].get, chunks)))
+else:
+ return self.filter_chunks(chunks)

Old JSON file format:
{
"status": "done",
"chunks": {
"app": [
{
"name": "app-0828904584990b611fb8.js",
"publicPath": "http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js",
"path": "/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js"
}
]
}
}

New JSON file format:
{
"status": "done",
"chunks": {
"app": ["app-0828904584990b611fb8.js"]
},
"assets": {
"app-0828904584990b611fb8.js": {
"name": "app-0828904584990b611fb8.js",
"publicPath": "http://localhost:3000/assets/bundles/app-0828904584990b611fb8.js",
"path": "/home/user/project-root/assets/bundles/app-0828904584990b611fb8.js"
}
}
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions