A minimalistic boilerplate for gotron and reactjs. Tested on Windows, macOS and Linux.
This project contains only bare minimum of tooling and dependencies to provide you with simple to understand and extensible base (but still, this is fully functional).
Make sure you have Node.js installed, then type the following commands known to every Node developer...
git clone https://github.com/Marlon-Monroy/gotron-react-boilerplate.git
cd gotron-react-boilerplate/ui
npm install
npm start
if you are using yarn
git clone https://github.com/Marlon-Monroy/gotron-react-boilerplate.git
cd gotron-react-boilerplate/ui
yarn
yarn start
This will download all the dependencies needed for react to work.
The application consists of...
ui
- Where all the ui and react related files live).
The build process compiles the content of the src
folder and puts it into the dist
folder, so after the build has finished, your dist
folder contains the full, runnable application.
I've used mod
for go depencency manager but i figured you might want to use something different so ive added the
go.mod
and go.sum
files to .gitignore
feel free to make changes as needed.
npm run dev
if you are using yarn
yarn run dev
Build process uses Webpack. The entry-points is src/index.js
. Webpack will follow all import
statements starting from those files and compile code of the whole dependency tree into one .js
file for each entry point.
Babel is also utilised.
Side note: Im using react 16.7.alpha2
so that i can use hook.
To do so edit ui/package.json
:
"dependencies": {
"react": "16.7"
}
Remember to respect the split between dependencies
and devDependencies
in package.json
file. Your distributable app will contain modules listed in dependencies
after running the release script.
To package your app:
cd gotron-react-boilerplate/ui
npm run build
Once the packaging process finished, the dist
directory will contain your distributable file.