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

Is there a way to rename public and build folders? #2394

Closed
apieceofbart opened this issue May 28, 2017 · 2 comments
Closed

Is there a way to rename public and build folders? #2394

apieceofbart opened this issue May 28, 2017 · 2 comments

Comments

@apieceofbart
Copy link

I am trying to setup gitlab pages deployment.

I would like to keep source files of my project in repo and have a CI script that runs npm run build to create a fresh version each time I commit something. The problem is that gitlabs CI expects the served files to be in public folder which is already taken by create-react-app.
Ideally I would change public folder to something else and have the npm run build command output the files to public folder instead of build.
Before I eject - do you know if this is possible without ejecting? Thanks for help

@gaearon
Copy link
Contributor

gaearon commented May 28, 2017

No, there is currently no way to do it.

You can always keep the project in a separate folder (e.g. app), and copy build product to the server's ../public as a build step after the build.

  "build": "react-scripts build && cp build/* ../public/"

Hope this helps!

@gaearon gaearon closed this as completed May 28, 2017
@apieceofbart
Copy link
Author

yeah, I was thinking about similar solution - it's the easiest by far - thanks!

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

No branches or pull requests

2 participants