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

Reproducible builds #739

Closed
shamrin opened this issue Jan 29, 2015 · 7 comments
Closed

Reproducible builds #739

shamrin opened this issue Jan 29, 2015 · 7 comments
Labels

Comments

@shamrin
Copy link

shamrin commented Jan 29, 2015

I'm building my web app + React, taken from npm (following advice from webpack docs). Everything works fine, except that builds are not reproducible.

Every time I run webpack for the same source, I get slightly different bundle.js, with changes like this:

-   var DOMProperty = __webpack_require__(33);
+   var DOMProperty = __webpack_require__(30);

-   var escapeTextForBrowser = __webpack_require__(34);
-   var memoizeStringOnly = __webpack_require__(35);
-   var warning = __webpack_require__(32);
+   var escapeTextForBrowser = __webpack_require__(31);
+   var memoizeStringOnly = __webpack_require__(32);
+   var warning = __webpack_require__(33);

Is there a way to make webpack build reproducible?

@sirlancelot
Copy link
Contributor

You could store the recordsPath which saves the module path with their IDs:

http://webpack.github.io/docs/configuration.html#recordspath-recordsinputpath-recordsoutputpath

However, until #295 is fixed, this will only work on the same machine recordsPath was created on.

@agundermann
Copy link

recordsPath or OccurenceOrderPlugin. See #408

@gaearon
Copy link
Contributor

gaearon commented Jan 29, 2015

I use OccurenceOrderPlugin for that.

@sokra sokra added the question label Feb 1, 2015
@cowwoc
Copy link

cowwoc commented Feb 6, 2015

@shamrin Out of curiosity, why do you need builds to be reproducible? (I don't doubt you have a good reason. I want to inform myself).

@gaearon
Copy link
Contributor

gaearon commented Feb 6, 2015

If you use hashes in filenames for long-term browser caching, you want them to stay the same for unchanged files.

@cowwoc
Copy link

cowwoc commented Feb 6, 2015

@gaearon Makes sense. Thanks!

@rugk
Copy link

rugk commented Dec 23, 2019

For anyone seeing this in 2019: The OccurenceOrderPlugin is now included by default, so builds should by default be reproducible:

The plugin is no longer needed and occurrence order is on by default.

https://gist.github.com/sokra/27b24881210b56bbaff7#occurrence-order

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

No branches or pull requests

7 participants