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

build and watch produce different hashes #10059

Open
srl295 opened this issue Dec 26, 2024 · 0 comments
Open

build and watch produce different hashes #10059

srl295 opened this issue Dec 26, 2024 · 0 comments

Comments

@srl295
Copy link

srl295 commented Dec 26, 2024

πŸ› bug report

parcel build … --no-content-hash and parcel watch … --no-content-hash produce different filename hashes.

πŸŽ› Configuration (.babelrc, package.json, cli command)

 npx parcel build --target=default --cache-dir=.parcel-cache --no-content-hash

πŸ€” Expected Behavior

Expect the same files with build and watch

😯 Current Behavior

build

$ npx parcel build --target=default --cache-dir=.parcel-cache --no-content-hash
✨ Built in 247ms
…
$ ls build/*
  • build/index.2f8490e0.js
  • build/index.2f8490e0.js.map
  • build/index.89a9d63e.css
  • build/index.89a9d63e.css.map
  • build/index.html

watch

$ npx parcel watch --target=default --cache-dir=.parcel-cache --no-content-hash
✨ Built in 31ms
^C
$ ls build/*
  • build/index.4ff28c68.js
  • build/index.4ff28c68.js.map
  • build/index.b5742bdb.css
  • build/index.b5742bdb.css.map
  • build/index.html

πŸ’ Possible Solution

while [[ 1 = 1 ]]; do npx parcel build --target=default --cache-dir=.parcel-cache --no-content-hash; echo Hit Enter to Rebuild; read junk; done

Workaround: I might also see if I can mutate the parcel-generated index.html in memory to serve my purposes.

πŸ”¦ Context

I'm trying to iterate on the files and noticed that they didn't seem to be changing when using watch.

And for more context, I am loading the files from a VSCode extension webview, so I have a dynamically generated index.html I need to use that includes some additional pieces.

πŸ’» Code Sample

package.json here - note, it's in an npm workspace.

🌍 Your Environment

Software Version(s)
Parcel 2.13.2
Node 18.20.4
npm/Yarn 10.7.0
Operating System mac x86-64 15.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant