Skip to content

Commit 14dbcd7

Browse files
committed
init commit
0 parents  commit 14dbcd7

9 files changed

+8522
-0
lines changed

.eslintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["airbnb", "prettier", "prettier/react"],
3+
"env": {
4+
"browser": true
5+
},
6+
"parser": "babel-eslint",
7+
"rules": {
8+
"no-unused-vars": "error",
9+
"no-plusplus": [0],
10+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
11+
"react/prop-types": [0],
12+
"react/jsx-props-no-spreading": [0],
13+
"import/prefer-default-export": [0],
14+
"react/no-array-index-key": [0],
15+
"arrow-body-style": [0],
16+
"prefer-arrow-callback": [0]
17+
}
18+
}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
.cache
4+
.parcel-cache

.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"arrowParens": "avoid"
7+
}

README.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Nano React App Default Javascript Template
2+
3+
The default template project for [nano-react-app](https://github.com/adrianmcli/nano-react-app).
4+
5+
- `npm start` — This will spawn a development server with a default port of `1234`.
6+
- `npm run build` — This will output a production build in the `dist` directory.
7+
8+
## Custom port
9+
10+
You can use the `-p` flag to specify a port for development. To do this, you can either run `npm start` with an additional flag:
11+
12+
```
13+
npm start -- -p 3000
14+
```
15+
16+
Or edit the `start` script directly:
17+
18+
```
19+
parcel index.html -p 3000
20+
```
21+
22+
## Adding styles
23+
24+
You can use CSS files with simple ES2015 `import` statements anywhere in your Javascript:
25+
26+
```js
27+
import "./index.css";
28+
```
29+
30+
## Babel transforms
31+
32+
The Babel preset [babel-preset-nano-react-app](https://github.com/nano-react-app/babel-preset-nano-react-app) is used to support the same transforms that Create React App supports.
33+
34+
The Babel configuration lives inside `package.json` and will override an external `.babelrc` file, so if you want to use `.babelrc` remember to delete the `babel` property inside `package.json`.
35+
36+
37+
## Deploy to GitHub Pages
38+
39+
You can also deploy your project using GitHub pages.
40+
First install the `gh-pages` [package](https://github.com/tschaub/gh-pages):
41+
42+
`npm i -D gh-pages`
43+
44+
With Parcel's `--public-url` flag, use the following scripts for deployment:
45+
46+
```
47+
"scripts": {
48+
"start": "parcel index.html",
49+
"build": "parcel build index.html --public-url '.'",
50+
"predeploy": "rm -rf dist && parcel build index.html --public-url '.'",
51+
"deploy": "gh-pages -d dist"
52+
},
53+
```
54+
55+
Then follow the normal procedure in GitHub Pages and select the `gh-pages` branch.

index.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>React Parcel Micro App</title>
5+
</head>
6+
<body>
7+
<div id="root"></div>
8+
<script src="./src/index.js"></script>
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)