Skip to content

Commit 15fdc04

Browse files
author
Hashem Khalifa
authored
Merge pull request #3 from HashemKhalifa/update-webpack-config
Update webpack config and babel
2 parents 48902e4 + 77c605d commit 15fdc04

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"presets": ["@babel/env", "@babel/react", "stage-2"],
2+
"presets": ["@babel/preset-env", "@babel/preset-react", "stage-2"],
33
"plugins": [
44
"@babel/plugin-transform-runtime",
55
"react-hot-loader/babel",

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
"babel/object-curly-spacing": 0
6969
},
7070
"env": {
71-
"jest/globals": true
71+
"es6": true,
72+
"jest": true,
73+
"browser": true,
74+
"node": true
7275
}
7376
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"precommit": "lint-staged"
1313
},
1414
"lint-staged": {
15-
"*.{js,json,css,md}": ["prettier --write --single-quote", "git add"],
16-
"*.{jsx, js}": [
15+
"*.{js,jsx,json,css,md}": [
1716
"prettier --write --single-quote",
1817
"eslint --fix",
1918
"git add"
@@ -69,6 +68,7 @@
6968
"eslint-plugin-prettier": "2.6.0",
7069
"eslint-plugin-react": "7.7.0",
7170
"eslint-watch": "3.1.4",
71+
"file-loader": "^1.1.11",
7272
"html-webpack-plugin": "3.2.0",
7373
"husky": "0.14.3",
7474
"identity-obj-proxy": "3.0.0",

webpack.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ module.exports = {
1919
test: /\.css$/,
2020
use: ['style-loader', 'css-loader'],
2121
},
22+
{
23+
test: /\.(png|jpg|gif|svg)$/,
24+
use: [
25+
{
26+
loader: 'file-loader',
27+
},
28+
],
29+
},
30+
{
31+
test: /\.(woff2|ttf|woff|eot)$/,
32+
use: [
33+
{
34+
loader: 'file-loader',
35+
},
36+
],
37+
},
2238
],
2339
},
2440
resolve: {
@@ -29,6 +45,7 @@ module.exports = {
2945
filename: 'bundle.js',
3046
},
3147
plugins: [
48+
new webpack.ProgressPlugin(),
3249
new HtmlWebpackPlugin({
3350
filename: 'index.html',
3451
template: `${__dirname}/src/template.html`,

0 commit comments

Comments
 (0)