N
N
Ninja Mate2016-01-11 19:49:11
xampp
Ninja Mate, 2016-01-11 19:49:11

I don't understand how to run React on localhost without Webpack?

I am at the beginning of my journey to learn ReactJS, my goal is to make a Theme for the WP engine.
I am using webpack. There were questions that I couldn't figure out on my own.
1 How to run React without Webpack, in the sense that I don’t understand how to make it work on the same localhost as WP which is on xampp (now on different ports thanks to Webpack)
2 How it all should look on the server With or without NodeJS ( compile js ) or run CGI-Node?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita Gushchin, 2016-01-11
@victorzadorozhnyy

There are isomorphic applications - they really won't start without a node. In fact, development happens like this - you write react + jsx + ES6 + ... code. Then you feed it all to webpack (and it's babel) and as a result you get a translated .js file that you can simply include like any other file and everything will work. You can do this runtime - but I have not done this and I don’t really understand why this should be done in real projects.

A
Anton Izmailov, 2016-01-11
@WapGeaR

How to run without webpack? Connect through <script>the react library and cut. Actually everything

U
UdjinStolboviy, 2020-12-04
@UdjinStolboviy

Hello! You just need to configure the package.json file correctly
, add the path of your domain or local server to it
"version": "0.1.0",
"private": true,

spoiler
"homepage": "localhost/react/1",

"dependencies": {}
then rebuild the production version and copy all the files from the build folder to the server. Everything should work out and the site will start.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question