Skip to content

Commit

Permalink
🎉 Create boilerplate!!
Browse files Browse the repository at this point in the history
  • Loading branch information
yami-beta committed Sep 25, 2018
1 parent 85f520c commit a33c05e
Show file tree
Hide file tree
Showing 9 changed files with 4,399 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
browser: true
node: true
commonjs: true
es6: true
extends:
- eslint:recommended
- plugin:prettier/recommended
parserOptions:
ecmaFeatures:
jsx: true
sourceType: module
overrides:
files: ['**/*.ts', '**/*.tsx']
parser: typescript-eslint-parser
rules:
no-undef: off
no-unused-vars: off
79 changes: 79 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
dist/

### https://raw.github.com/github/gitignore/210c95bb02f629e5166c21e888b10d0c26442fe7/Node.gitignore

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless


Empty file added .prettierrc.yml
Empty file.
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "react-boilerplate",
"version": "0.0.1",
"main": "index.js",
"repository": "ssh://git@github.com/yami-beta/react-boilerplate",
"author": "yami-beta <yami-beta@users.noreply.github.com>",
"license": "MIT",
"private": true,
"scripts": {
"lint": "eslint",
"build:ts": "webpack --mode production",
"watch:ts": "webpack-dev-server --mode development",
"build": "run-p build:*",
"watch": "run-p watch:*"
},
"devDependencies": {
"@types/react": "^16.4.14",
"@types/react-dom": "^16.0.7",
"eslint": "^5.6.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-prettier": "^2.6.2",
"html-webpack-plugin": "^3.2.0",
"npm-run-all": "^4.1.3",
"prettier": "^1.14.3",
"ts-loader": "^5.2.0",
"typescript": "^3.0.3",
"typescript-eslint-parser": "^18.0.0",
"webpack": "^4.19.1",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.9"
},
"dependencies": {
"react": "^16.5.2",
"react-dom": "^16.5.2"
}
}
11 changes: 11 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
12 changes: 12 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import { render } from "react-dom";

const App = () => {
return (
<div>
<h1>Hello World</h1>
</div>
);
};

render(<App />, document.getElementById("root"));
11 changes: 11 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": ["es2018", "dom"],
"jsx": "react",
"sourceMap": true,
"noUnusedLocals": true,
"esModuleInterop": true
}
}
39 changes: 39 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");

let publicPath = "/";

module.exports = {
mode: "development",
entry: {
index: [path.join(__dirname, "src", "index.tsx")]
},
output: {
path: path.join(__dirname, "dist"),
filename: "[name].js",
publicPath
},
resolve: {
extensions: [".js", ".jsx", ".ts", "tsx"]
},
module: {
rules: [
{
test: /\.(ts|tsx|js|jsx)$/,
use: ["ts-loader"],
exclude: /node_modules/
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, "src", "index.html")
})
],
devServer: {
contentBase: path.join(__dirname, "dist"),
historyApiFallback: true,
watchContentBase: true,
compress: true
}
};
Loading

0 comments on commit a33c05e

Please sign in to comment.