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

Exclude some paths while building for production #2804

Closed
arajajyothibabu opened this issue Jul 17, 2017 · 4 comments
Closed

Exclude some paths while building for production #2804

arajajyothibabu opened this issue Jul 17, 2017 · 4 comments

Comments

@arajajyothibabu
Copy link

I came across this requirement where I have to exclude some folders from public directory in production build (npm run build).

Is there any option to exclude some paths say

build: "react-scripts build --exclude=public/data",

Or else any other way around to achieve this ?

Thank you

@gaearon
Copy link
Contributor

gaearon commented Jul 17, 2017

You can do this manually, e.g.

"build": "react-scripts build && rm -rf build/data"

But I would say if something isn’t public, it shouldn’t go into the public directory.

@arajajyothibabu
Copy link
Author

arajajyothibabu commented Jul 17, 2017

@gaearon Thanks Dan, but where should I keep this data folder in order to have this on root during development. I mean http://localhost:3000/data/someFile ?

@gaearon
Copy link
Contributor

gaearon commented Jul 17, 2017

Yes, in this case the first approach I suggested (doing it manually) will work fine.

@ydsood
Copy link

ydsood commented Aug 23, 2018

This is an older thread, however, an exception to this rule

But I would say if something isn’t public, it shouldn’t go into the public directory.

is the .svn folder for svn repositories. (Please don't yell at me for using svn over git)

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants