kentcdodds / kcd-scripts

CLI toolbox for common scripts for my projects
http://npm.im/kcd-scripts
MIT License
885 stars 207 forks source link

Babel removes test files from src directory after building #163

Open MichaelDeBoey opened 4 years ago

MichaelDeBoey commented 4 years ago

Relevant code or config

$ kcd-scripts build --out-dir .

What you did: Run npm run build in the root of the project

What happened: src/__tests__/gatsby-node.js was deleted

Reproduction repository: https://github.com/MichaelDeBoey/gatsby-plugin-pinterest/tree/support-pluginOptionsSchema

Problem description: When implementing https://github.com/robinmetral/gatsby-plugin-pinterest/pull/15 and running npm run build or npm run validate in the root of the project, src/__tests__/gatsby-node.js was deleted.

Suggested solution: Investigation needed 🤔

kentcdodds commented 4 years ago

I'm guessing it's an issue with this code:

https://github.com/kentcdodds/kcd-scripts/blob/4961e9741460825131f5de47d93d41b0a9ffe99d/src/scripts/build/babel.js#L53-L64