google / eleventy-high-performance-blog

A high performance blog template for the 11ty static site generator.
https://www.industrialempathy.com/posts/eleventy-high-performance-blog/
MIT License
4.01k stars 283 forks source link

Mocha as a `dependency` #132

Open nucliweb opened 2 years ago

nucliweb commented 2 years ago

Hello,

I see that the mocha package is as a dependency and I think that is a devDependency, right?

cramforce commented 2 years ago

This template does run the tests after every build to ensure the build is good.

nucliweb commented 2 years ago

Ok, but the tests run in dev or deploy mode. We don't need mocha in the production bundle, so if we move as a devDependency the mocha is available to run in build time because is installed too in the install process.

I know, if we don't import mocha in the code, mocha isn't part of the bundle but is a best practice to add as a dependencies only the packages needed to use in production or if the package is a tool or library.

cramforce commented 2 years ago

Nothing from package.json is currently bundled. I see the case of moving 100% of deps into devDepencencies. Feel free to send a PR.