Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore co-located tests files when using --copy-files in build step #529

Closed
vale2628 opened this issue May 8, 2019 · 4 comments
Closed

Comments

@vale2628
Copy link

vale2628 commented May 8, 2019

This issue is a: Question / support request / Feature request

I'm using React-create-component-library and as part of the build process I added --copy-files in the react build step to bring over .scss/.css files. However I also have my .specs files in the /src directory. Is there a way to exclude them? I tried ignoring it using babel-loader but it did not work.

Perhaps a --ignore files need to be added??
https://babeljs.io/docs/en/babel-cli#ignore-files

`

@shivangsanghi
Copy link

For the time being, you can update your build script to somehow like below:
"build": "nwb build-react-component --copy-files --no-demo && find lib/ -name '*.specs.js' -delete",

@insin
Copy link
Owner

insin commented Mar 11, 2020

nwb is already telling Babel to ignore .test.js/.spec.js files in src/, but --copy-files doesn't respect the ignore config.

A recent version gained a --no-copy-ignored flag which should fix this.

@insin insin closed this as completed in a88418b Mar 11, 2020
@insin
Copy link
Owner

insin commented Mar 12, 2020

Released in v0.24.2

@mihai-ro
Copy link

@insin , on the same topic, is there currently a way to exclude files from being added to the build? e.g. storybook files or mdx, located in the same folder with the component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants