Introduction

This is a simple tutorial that produces the project https://github.com/paulojeronimo/react-parcel-quickstart.

Steps

$ mkdir react-parcel-quickstart && cd $_
$ npm init -y
$ npm i -D parcel
$ npm i react react-dom
$ mkdir src && cat > src/index.html <<'EOF'
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My Parcel App</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="index.js"></script>
  </body>
</html>
EOF
$ cat > src/index.js <<'EOF'
import ReactDOM from "react-dom";
import { App } from "./App";

const app = document.getElementById("app");
ReactDOM.render(<App />, app);
EOF
$ cat > src/App.js <<'EOF'
export function App() {
  return <h1>Hello world!</h1>;
}
EOF
$ npx parcel src/index.html
$ cat > LICENSE <<'EOF'
MIT License

Copyright (c) 2022 Paulo Jerônimo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
EOF
$ cat > README.adoc <<'EOF'
= React Parcel Quickstart

This is a quickstart project that you can use to create React + Parcel
projects.
It was created by following the steps in the tutorial
https://paulojeronimo.com/react-parcel-quickstart-tutorial

== How to use it?

This will extract this project to the directory `my-new-project`
project:

....
$ mkdir my-new-project && cd $_ && \
curl -L https://github.com/paulojeronimo/react-parcel-quickstart/archive/refs/heads/main.tar.gz | \
tar xz --strip-components=1
....

After that, you can update the name of the project in `package.json`
with the following command:

....
$ npx change-package-name my-new-project
....

== Installation

....
$ npm install
....

== Execution

....
$ npx parcel src/index.html
....

Open http://localhost:1234.
EOF
$ cat > .gitignore <<'EOF'
node_modules
.parcel-cache
dist
EOF
$ git init
$ git add -A
$ git commit -m 'Initial commit'

References