I have build my ReactJS Application with npm build and final I have bundle.js and other dependencies which is bundled using with Babel and webpack modules.
In my final dist folder which has index.html which is pointing bundle.js ( as below )
<!DOCTYPE html>
<html lang="en">
<head><link rel="stylesheet" href="styles.css">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://npmcdn.com/react-bootstrap-table/dist/react-bootstrap-table-all.min.css">
</head>
<body>
<div id="app"></div>
<script src="bundle.js"></script>
</body>
</html>
Below is the dist folder which generated after npm build.
Locally I am able to launch my application using npm start, but now my question is how can I deploy this static folder into Wildfly 18.x ? so I can launch my ReactJS code.
WildFly is an application server meant for hosting JVM-based web applications, so it's unusual to deploy JS-based app on it.
What you need to do is to create a war file form your dist folder and then deploy it in WildFly using its management console or JBoss CLI.
You can find some more details on war files here and here. There are also details on creating wars for ReactJS apps here and here. Finally WildFly 18 documentation on application deployment is available here.