parcel build --no-content-hash <file>.html

Created on 25 Sep 2018  路  3Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

parcel build --no-content-hash <file>.html
does nothing, just builds and hashes the files as usual.

It does work for .js files, but not .html files referencing js/scss etc...

馃帥 Configuration (.babelrc, package.json, cli command)

parcel build --no-content-hash index.html or
parcel build index.html --no-content-hash still hashes the filenames.

馃 Expected Behavior

Unless I'm way off, and this literally only applies to content within the files not being hashed鈥攊t should indeed build without hashes in the filenames... Right?

馃槸 Current Behavior

Hashes the output files...

馃拋 Possible Solution

?

馃敠 Context

Would be an awesome feature for cases where the parcel part of a big php/twig project isn't feasible to potentially update hashed filenames across hundreds of files.

馃捇 Code Sample

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.10.0
| Node | 8.12.0
| npm/Yarn | 6.4.1/1.9.4
| Operating System | macOS 10.13.6

Most helpful comment

Hashes will still be added to the files, but not content hashes. i.e. the hashes will not change every build based on the content. Instead, the hashes are based on the filename.

We cannot completely remove the hashes because the output directory structure is flattened. If we removed the hashes, there might be conflicting output file names.

All 3 comments

Hashes will still be added to the files, but not content hashes. i.e. the hashes will not change every build based on the content. Instead, the hashes are based on the filename.

We cannot completely remove the hashes because the output directory structure is flattened. If we removed the hashes, there might be conflicting output file names.

Gotcha, thanks! Wouldn't mind that feature, though. I suppose one could cook something up with buildend somehow...

@devongovett Is it possible to retain original directory structure and filenames, without flattening and any hashes in filenames?

There were already issue #433 with PR #557, but they were both closed without support for that. Is there any chance this can be implemented now (maybe with some --preserve-directory-structure flag)?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzimmek picture jzimmek  路  3Comments

dsky1990 picture dsky1990  路  3Comments

Niggler picture Niggler  路  3Comments

donaldallen picture donaldallen  路  3Comments

medhatdawoud picture medhatdawoud  路  3Comments