Closed
Description
I need to change to build directory for using create-react-app.
In issue #3824 it was recommended to add a postbuild step:
"postbuild": "cp build/* restapi/wwwroot"
That works, but pushing it a colleague working on windows started complaining that the build now crashes on his computer (since mv
is not crossplatform).
Is there any way of doing this in create-react-app
now in 2019 without ejecting?
Activity
TheKnarf commentedon Jan 16, 2019
I solved my own problem by making a
postbuild.js
script using the copy package:and changing
package.json
into:However I still think there should be a standard way to configure this as its a fairly common usecase.
ianschmitz commentedon Jan 16, 2019
You could use a package like ncp which works cross platform.
TheKnarf commentedon Jan 16, 2019
@iainbeeston see my second comment, I already fixed it with those tree lines and the
copy
package. But I'm still hoping for a "standard" / "built inn" way of doing it with create-react-app so that we don't need to add any other third party dependencies. Setting the build directory is obviously already supported in Webpack which create-react-app uses under the hood. However there's no way of changing the Webpack config without ejecting the app. A simple command line option to the build to override the output dir would be preferred.stale commentedon Feb 16, 2019
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
stale commentedon Feb 21, 2019
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.