django-webpack-loader icon indicating copy to clipboard operation
django-webpack-loader copied to clipboard

Hashes in the path are not allowed

Open x-yuri opened this issue 8 years ago • 0 comments

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'])

x-yuri avatar Nov 19 '16 18:11 x-yuri