4

I am new to react.js, and trying to deploy first beta app for which I used webpack to build it, now I have got build.js file. Now as per my understanding to deploy build.js I don't need to setup any thing in server, I just need to put following things

  1. index.html
  2. build.js pointed from inside index.html
  3. Resources and Styles in their respective folder structure.

Am I going in right direction? Do I need to install npm/node etc on the server? or, just putting all the resources will work?

Thanks

5
  • Should Just Work™ Have you tried it and it's not working? If so, please share details and logs Commented Mar 26, 2018 at 5:35
  • Yes, you'll need to install all the dependencies from npm. Commented Mar 26, 2018 at 5:38
  • 2
    Correct, it's all just static files, which can be served from any server, e.g. Apache, no need for node on the server, unless you want to use a node server like Express Commented Mar 26, 2018 at 5:39
  • Thanks for details, it seems working fine with all resources together.. thanks for confirming.. Commented Mar 26, 2018 at 5:46
  • 1
    This question would be actually a good place to collect and explain the react building process ... Commented Mar 26, 2018 at 6:00

1 Answer 1

1

As several commenters have mentioned, the method you outline is likely to "just work". A module bundler like Webpack is designed to take all your code and its dependencies and bundle them together in a set of files that can be executed directly in the runtime environment. For a simple client-side web application, the runtime environment is a web browser, so all you need is a way to serve the bundled files to the users' browsers.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.