This way, your project won’t depend on someone from across the globe submitting erroneous packages to the. The bottom line: Push the yarn.lock of the project that works and builds correctly into your version control system to ensure that the entire team has a reproducible and working build. A minute later, the entire team got an email titled “Who broke the build?” But imagine a team working on a project for some time, and their github repo didn’t include the yarn.lock file that stored the reference to the working version 1.1.6 of that plugin, and Mary (the QA engineer) decided to make a production build. This was a specific issue with the newly generated project created at the “wrong time”. Thank you, the Webpack team for the quick turnaround! Happy end! This time it picked up the fixed 1.1.8 version and the ng build –prod command started working again. My project already had the yarn.lock file with an erroneous version of this plugin. The Angular team got in touch with them, and an hour later, the fixed version 1.1.8 of the Webpack UglifyJS plugin was pushed to the npm central repo. To make the long story short, the WebPack team pushed to the new version 1.1.7 this plugin, which was empty. The generated package.json file located in the root of my project has no direct dependency on uglifyjs-webpack-plugin, but there is one deep inside node_modules in one of the thousand (literally) dependencies used in Angular CLI projects. I know that Webpack uses UglifyJS for optimizing sizes of the bundles, which is great, but my production build fails, which is not great at all. Then, I wanted to create a production build with ng build –prod, but the build failed with the error Cannot find module ‘uglifyjs-webpack-plugin’. The project was successfully generated and started with ng serve. Yesterday, I had to create a new project using Angular CLI. Last year, I wrote about a specific use case that caused a breaking change during one of my Angular workshops. Besides being faster than npm, yarn creates a file yarn.lock that stores the exact versions of installed dependencies. I use the Yarn package manager for all my Angular projects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |