Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "entry",
"corejs": "3.0.0"
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-proposal-class-properties"
]
}
41 changes: 41 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"parser": "babel-eslint",
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"node": true,
"mocha": true,
"es6": true,
"jest": true
},
"rules": {
"indent": ["error", 4],
"space-before-function-paren": "off",
"react/prefer-stateless-function": "warn",
"react/jsx-one-expression-per-line": "off",
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": true }
],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"linebreak-style": "off",
"global-require": "off",
"semi": "warn",
"arrow-body-style": "off",
"no-multiple-empty-lines": ["warn", { "max": 1 }],
"no-unused-expressions": [
"error",
{
"allowTaggedTemplates": true
}
],
"no-underscore-dangle": ["error", { "allow": ["__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"] }]
}
}
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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

# next.js build output
.next
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 80,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": true
}
12 changes: 12 additions & 0 deletions config/webpack/paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import path from 'path';

module.exports = {
root: path.resolve(__dirname, '../', '../'),
outputPath: path.resolve(__dirname, '../', '../', 'build'),
entryPath: path.resolve(__dirname, '../', '../', 'src/index.js'),
templatePath: path.resolve(__dirname, '../', '../', 'src/index.html'),
imagesFolder: 'images',
fontsFolder: 'fonts',
cssFolder: 'css',
jsFolder: 'js'
};
43 changes: 43 additions & 0 deletions config/webpack/rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
exclude: /node_modules/,
loader: 'file-loader'
},
{
test: /\.(woff|woff2)$/,
exclude: /node_modules/,
loader: 'url-loader?prefix=font/&limit=5000'
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
exclude: /node_modules/,
loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
use: ['url-loader?limit=10000', 'img-loader']
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
]
},
{
test: /\.s(a|c)ss$/,
use: [ 'style-loader', 'css-loader', 'sass-loader' ]
},
];
30 changes: 30 additions & 0 deletions config/webpack/webpack.common.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';

import paths from './paths';
import rules from './rules';

module.exports = {
entry: paths.entryPath,
module: {
rules
},
resolve: {
modules: ['src', 'node_modules'],
extensions: ['*', '.js', '.scss', '.css']
},
plugins: [
new webpack.ProgressPlugin(),
new HtmlWebpackPlugin({
template: paths.templatePath,
minify: {
collapseInlineTagWhitespace: true,
collapseWhitespace: true,
preserveLineBreaks: true,
minifyURLs: true,
removeComments: true,
removeAttributeQuotes: true
}
})
]
};
40 changes: 40 additions & 0 deletions config/webpack/webpack.dev.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import webpack from 'webpack';
import Jarvis from 'webpack-jarvis';

import paths from './paths';

module.exports = {
mode: 'development',
output: {
filename: '[name].js',
path: paths.outputPath,
chunkFilename: '[name].js'
},
performance: {
hints: 'warning',
maxAssetSize: 20000000,
maxEntrypointSize: 8500000,
assetFilter: assetFilename => {
return (
assetFilename.endsWith('.css') || assetFilename.endsWith('.js')
);
}
},
optimization: {
splitChunks: {
chunks: 'all'
}
},
devServer: {
contentBase: paths.outputPath,
compress: true,
hot: true,
historyApiFallback: true
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new Jarvis({
port: 1337
})
]
};
18 changes: 18 additions & 0 deletions config/webpack/webpack.prod.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import CleanWebpackPlugin from 'clean-webpack-plugin';

import paths from './paths';

module.exports = {
mode: 'production',
output: {
filename: `${paths.jsFolder}/[name].[hash].js`,
path: paths.outputPath,
chunkFilename: '[name].[chunkhash].js'
},
plugins: [
new CleanWebpackPlugin([paths.outputPath.split('/').pop()], {
root: paths.root
})
],
devtool: 'source-map'
};
Loading