Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add compiler output options support for hash #121

Open
aarefiev opened this issue Dec 21, 2018 · 5 comments
Open

Feature: add compiler output options support for hash #121

aarefiev opened this issue Dec 21, 2018 · 5 comments

Comments

@aarefiev
Copy link

Hi!

It will be cool if loader will support output options of webpack, especially options for hash like as hashDigestLength. It is very useful if I should have the same length for all files after compilation. But now, I should set the same setting for all loaders that using loader-utils for processing files in core.

According to my opinion I should stay here proof based on webpack documentation (https://webpack.js.org/configuration/output/#output-filename):

The lengths of [hash] and [chunkhash] can be specified using [hash:16] (defaults to 20). Alternatively, specify output.hashDigestLength to configure the length globally.

The main word is globally, I expect that global scope is including loaders too.

@jahed
Copy link

jahed commented Mar 22, 2020

Has there been any progress on this? Anything needed? It would be nice to support hashDigestLength for consistency when using loaders like file-loader. I noticed the PR (#120) has been left open.

@alexander-akait
Copy link
Member

Should be solved on webpack side

@alexander-akait
Copy link
Member

No, it is won't fix, we can't calculate hash of build on loader side

@alexander-akait
Copy link
Member

@rightaway it is won't fix, no need issues, you can use output: 'dist/[hash]' if you need unique directory on build

@jahed
Copy link

jahed commented Mar 25, 2020

@evilebottnawi I'm using [contenthash] for my project outputs so it would be nice if loader-utils supported output.hashDigestLength for that like Webpack's outputs do.

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

No branches or pull requests

3 participants