codejockie
codejockie

Reputation: 10864

Build library and include CSS files but not test files

I am currently working on a React library. When I run build the css files are ignored. I added the flag --copy-files to the build script, now it copies the css files and also the test files.

I currently have this in the script: babel src/ --out-dir lib --ignore spec.js --copy-files

How do I setup the build script so it ignores the test files and copy every other files?

Upvotes: 2

Views: 226

Answers (2)

codejockie
codejockie

Reputation: 10864

The existing script happened to be working all I needed to do was delete the already existing compiled lib directory which for a reason still had the tests folder/files included.

For future purposes, if you want to exclude a file from being compiled or copied over, add them to the include flag like so: --ignore spec.js.

I hope this helps anyone that run into the same issue.

Upvotes: 1

Jee Mok
Jee Mok

Reputation: 6556

babel src/ --out-dir lib --ignore spec.js --copy-files

the code above should be working. Probably you can delete the lib folder and try build again to see if the test files are still there.

Upvotes: 1

Related Questions