Preact-cli: Same bundle hash for modified content across two builds

Created on 12 Jan 2018  路  9Comments  路  Source: preactjs/preact-cli

Do you want to request a feature or report a bug?
Bug

What is the current behaviour?
I get stable hashes for my bundle.js across multiple builds with modified files.

If the current behaviour is a bug, please provide the steps to reproduce.
Create a new project via preact-cli (default template) build it, add something in app.js and rebuild it.
Both artifact versions (bundle.js) get the same hash which breaks distributing via CDN.

What is the expected behaviour?
The second run should generate a different hash. I don鈥檛 tried the same thing with the style.css bundle. Maybe it鈥檚 the same thing.

Please mention other relevant information.

  • Node version 9.4
  • npm version bundled version
  • Operating system OSX
  • CLI version latest
  • Browser all

P.S.: besides this I鈥檓 in love with this cli. Everything works OOTB or can be added via plugin or a small configuration. Great work!

bug

Most helpful comment

Thanks for pointing this our @otbe! Looks like it was affecting my builds too. 馃憥 For auto-resolving semver dependencies, haha.

I'll try to send in a fix now.

All 9 comments

@otbe what command/flags are you using to build the app?

Only the default ones. A simple preact build (or npm run build) leads to this error.

preact-cli version?

2.1.0 (installed today :))

There is a test repo: https://github.com/otbe/preact-cli-test

$ npm i 
$ npm run build

Note the hash from bundle.[hash].js; go to app.js and add something after foo

$ npm run build

On my machine I get the same hashes for both builds. :/

checking now

wow this actually is a bug. how is this never caught before is amazing!
or may be i out of touch and missing something super obvious

Thanks for pointing this our @otbe! Looks like it was affecting my builds too. 馃憥 For auto-resolving semver dependencies, haha.

I'll try to send in a fix now.

Thanks for the fast fix! Works for me 馃憤

Was this page helpful?
0 / 5 - 0 ratings