django-webpack-loader
django-webpack-loader copied to clipboard
Hashes in the path are not allowed
I'm able to do the following in webpack:
module.exports = {
...
output: {
path: path.resolve('../webpack_bundles/[hash]'),
filename: '[name].js',
},
...
};
But django-webpack-loader
doesn't allow that. Here you expect to have a path to the chunk. But if the hash is in the path, it's not known in advance.
Can't we add, say, BUNDLE_DIR_PATH
and do something along these lines?
import os.path
if 'BUNDLE_DIR_PATH' in self.config:
relpath = os.path.relpath(chunk['path'], self.config['BUNDLE_DIR_PATH'])