Skip to content

Commit 3bd3f58

Browse files
author
Ayush Krishnatray
committed
adding routes, configuration and data
1 parent 92c3f00 commit 3bd3f58

File tree

97 files changed

+1966
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1966
-373
lines changed

.babelrc

+10
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,15 @@
22
"presets": [
33
"@babel/preset-env",
44
"@babel/preset-react"
5+
],
6+
"plugins": [
7+
["@babel/plugin-transform-runtime",
8+
{
9+
"regenerator": true
10+
}
11+
],
12+
[
13+
"@babel/plugin-proposal-class-properties"
14+
]
515
]
616
}

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"quotes": ["error", "single"],
3939
"react/jsx-filename-extension": 0,
4040
"react/destructuring-assignment": 0,
41+
"react/forbid-prop-types": 0,
4142
"semi": ["error", "always"],
4243
"comma-dangle": ["error", "never"]
4344
}

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 80
4+
}

.stylelintrc

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
],
55
"extends": ["stylelint-config-recommended"],
66
"rules": {
7-
"scss/dollar-variable-pattern": "^foo",
87
"scss/selector-no-redundant-nesting-selector": true,
98
"at-rule-no-unknown": null,
109
"scss/at-rule-no-unknown": true

config/webpack/path.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
root: path.resolve(__dirname, '../../'),
5+
outputPath: path.resolve(__dirname, '../../', 'dist'),
6+
entryPath: path.resolve(__dirname, '../../', 'src/index.js'),
7+
templatePath: path.resolve(__dirname, '../../', 'src/index.html'),
8+
commonStyles: path.resolve(__dirname, '../../', 'src/styles')
9+
};

config/webpack/webpack.common.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
const HtmlWebPackPlugin = require('html-webpack-plugin');
2+
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
3+
const commonPaths = require('./path');
4+
5+
module.exports = {
6+
// Webpack 4 by default has a default entry point of index.js in your src folder
7+
entry: commonPaths.entryPath,
8+
output: {
9+
filename: 'bundle.js',
10+
path: commonPaths.outputPath
11+
},
12+
module: {
13+
rules: [
14+
{
15+
exclude: /node_modules/,
16+
test: /\.(js|jsx)$/,
17+
use: ['babel-loader']
18+
}]
19+
},
20+
resolve: {
21+
extensions: ['*', '.js', '.jsx', '.scss']
22+
},
23+
devServer: {
24+
port: 3333,
25+
historyApiFallback: true,
26+
publicPath: '',
27+
contentBase: commonPaths.outputPath,
28+
hot: true
29+
},
30+
plugins: [
31+
// Now, every Webpack build will wipe the content of your dist/ folder
32+
// before creating the new dist/index.html and dist/bundle.js files from scratch.
33+
new CleanWebpackPlugin(),
34+
new HtmlWebPackPlugin({
35+
template: commonPaths.templatePath
36+
})
37+
]
38+
};

config/webpack/webpack.dev.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module.exports = {
2+
mode: 'development',
3+
devtool: 'inline-source-map',
4+
module: {
5+
rules: [
6+
// node-sass provides binding for Node.js to LibSass, a Sass compiler.
7+
// sass-loader is a loader for Webpack for compiling SCSS/Sass files.
8+
// style-loader injects our styles into our DOM.
9+
// css-loader interprets @import and @url() and resolves them.
10+
// mini-css-extract-plugin extracts our CSS out of the JavaScript bundle into a separate file, essential for production builds.
11+
{
12+
test: /\.s(a|c)ss$/,
13+
loader: [
14+
'style-loader',
15+
{
16+
loader: 'css-loader',
17+
options: {
18+
sourceMap: true,
19+
modules: {
20+
localIdentName: '[local]'
21+
}
22+
}
23+
},
24+
{
25+
loader: 'sass-loader',
26+
options: {
27+
sourceMap: true
28+
}
29+
}
30+
]
31+
}
32+
]
33+
}
34+
};

config/webpack/webpack.prod.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2+
3+
module.exports = {
4+
// optimization: {
5+
// splitChunks: {
6+
// chunks: 'all'
7+
// }
8+
// },
9+
mode: 'production',
10+
module: {
11+
rules: [
12+
// node-sass provides binding for Node.js to LibSass, a Sass compiler.
13+
// sass-loader is a loader for Webpack for compiling SCSS/Sass files.
14+
// style-loader injects our styles into our DOM.
15+
// css-loader interprets @import and @url() and resolves them.
16+
// mini-css-extract-plugin extracts our CSS out of the JavaScript bundle into a separate file, essential for production builds.
17+
{
18+
test: /\.s(a|c)ss$/,
19+
loader: [
20+
MiniCssExtractPlugin.loader,
21+
{
22+
loader: 'css-loader',
23+
options: {
24+
modules: true,
25+
sourceMap: false
26+
}
27+
},
28+
{
29+
loader: 'sass-loader',
30+
options: {
31+
sourceMap: false
32+
}
33+
}
34+
]
35+
}
36+
]
37+
},
38+
plugins: [
39+
new MiniCssExtractPlugin({
40+
filename: '[name].[hash].css',
41+
chunkFilename: '[id].[hash].css'
42+
})
43+
]
44+
};

0 commit comments

Comments
 (0)