Built result will be different when environment change or node_modules be reinstalled
See original GitHub issueDescribe the bug Build result will change when reinstall node_modules. This will lead to the problem of the source code review when the expanded store is launched. As I encountered, when upload to firefox addon center, the code-reviewer reminded the code built result differently from the uploaded code.
To Reproduce Steps to reproduce the behavior:
npm run build- Save production zip file
- Delete node_modules dir
npm install && npm run build- compare the two production file
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Why do Node modules go into .staging folder? - Stack Overflow
Note: - ".staging" means, those dependencies are getting downloaded so for the temporary basis it keeps all those dependencies under ".staging" ...
Read more >JavaScript Best Practices and node_modules - Julie Ng
The JavaScript ecosystem and how it stores modules locally in the project can be frickle. Especially when coming from another language, ...
Read more >How To Use Node.js Modules with npm and package.json
The first step will be to create and understand the package.json file. You will then use it to keep track of all the...
Read more >What's Really Going On Inside Your node_modules Folder?
Anyone running npm install without a package-lock.json file was compromised. Anyone unlucky enough to update to a new version of ua-parser-js , ...
Read more >[FEATURE] Do not remove node_modules on npm ci #564
Only install/remove a package if its version in node_modules and the main package. json are different, OR if the package is completely missing ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yeah, I know Mozilla likes to have deterministic code. It’s understandably desirable to have the same output each time, hence my surprise about the issue.
I’m happy you found a solution that works for you.
What I mean is that the location of the final generated JS code in the file may change, or the variable name may change (sorry, I don’t know much about the code after the build, in short, after each build, the generated code changed)
In most cases, this change will not cause problems, but mozilla requires that extensions that use webpack upload source code for review. I think they might use something like ‘diff’ in the background to compare the results.
When uploading to chrome webstore or microsoft store (Edge) there is no problem.