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

How to build the code to one directory when exec 'npm run start' #4663

Closed
TerryChenUI opened this issue Jun 22, 2018 · 4 comments
Closed

How to build the code to one directory when exec 'npm run start' #4663

TerryChenUI opened this issue Jun 22, 2018 · 4 comments

Comments

@TerryChenUI
Copy link

Now when I exec command of 'npm run start', it will not build the code to directory.
I want to watch the file and rebuild the code to one directory.
how to config it?

@bugzpodder
Copy link

Can you clarify what you are trying to accomplish?
Are you trying to run a single command that both runs the app via npm run start, and builds your app via npm run build? And you also want to retriggering the build when a file changes?

Building the app takes a long time for large apps, so I would not recommend rebuilding everytime there is a file change.

@TerryChenUI
Copy link
Author

TerryChenUI commented Jul 27, 2018

For example,

  1. I config a host like this:
127.0.0.1 abc.com
  1. I config nginx to direct the UI code dist directory which is compiled by devmode.

So when I change a file, then rebuild to the dist directory, how can it work?

@bugzpodder
Copy link

So create-react-app doesn't support rebuilding the app every time a file changes because building takes a long time.

@Timer
Copy link
Contributor

Timer commented Sep 17, 2018

Duplicate of #1070

@Timer Timer marked this as a duplicate of #1070 Sep 17, 2018
@Timer Timer closed this as completed Sep 17, 2018
@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants