eleventy-high-performance-blog icon indicating copy to clipboard operation
eleventy-high-performance-blog copied to clipboard

Mocha as a `dependency`

Open nucliweb opened this issue 3 years ago • 3 comments
trafficstars

Hello,

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

nucliweb avatar Mar 15 '22 06:03 nucliweb

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

cramforce avatar Mar 15 '22 16:03 cramforce

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.

nucliweb avatar Mar 15 '22 17:03 nucliweb

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

cramforce avatar Mar 15 '22 17:03 cramforce