Skip to content

Commit 5aca3e4

Browse files
committed
ref: #187 update 03,04 package.json
1 parent d38144d commit 5aca3e4

File tree

4 files changed

+78
-76
lines changed

4 files changed

+78
-76
lines changed

hooks/03_State/package.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@
1515
"author": "Braulio Diez Botella",
1616
"license": "MIT",
1717
"devDependencies": {
18-
"@babel/cli": "^7.2.3",
19-
"@babel/core": "^7.2.2",
20-
"@babel/polyfill": "^7.2.5",
21-
"@babel/preset-env": "^7.3.1",
22-
"@types/react": "^16.8.3",
23-
"@types/react-dom": "^16.8.1",
18+
"@babel/cli": "^7.10.5",
19+
"@babel/core": "^7.10.5",
20+
"@babel/polyfill": "^7.10.4",
21+
"@babel/preset-env": "^7.10.4",
22+
"@types/react": "^16.9.43",
23+
"@types/react-dom": "^16.9.8",
2424
"awesome-typescript-loader": "^5.2.1",
25-
"babel-loader": "^8.0.5",
26-
"css-loader": "^2.1.0",
27-
"file-loader": "^3.0.1",
28-
"html-webpack-plugin": "^3.2.0",
29-
"mini-css-extract-plugin": "^0.5.0",
30-
"style-loader": "^0.23.1",
31-
"typescript": "^3.3.3",
32-
"url-loader": "^1.1.2",
33-
"webpack": "^4.29.3",
34-
"webpack-cli": "^3.2.3",
35-
"webpack-dev-server": "^3.1.14"
25+
"babel-loader": "^8.1.0",
26+
"css-loader": "^3.6.0",
27+
"file-loader": "^6.0.0",
28+
"html-webpack-plugin": "^4.3.0",
29+
"mini-css-extract-plugin": "^0.9.0",
30+
"style-loader": "^1.2.1",
31+
"typescript": "^3.9.7",
32+
"url-loader": "^4.1.0",
33+
"webpack": "^4.43.0",
34+
"webpack-cli": "^3.3.12",
35+
"webpack-dev-server": "^3.11.0"
3636
},
3737
"dependencies": {
38-
"react": "^16.8.2",
39-
"react-dom": "^16.8.2"
38+
"react": "^16.13.1",
39+
"react-dom": "^16.13.1"
4040
}
4141
}

hooks/03_State/webpack.config.js

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
var HtmlWebpackPlugin = require("html-webpack-plugin");
2-
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
3-
var webpack = require("webpack");
4-
var path = require("path");
1+
const HtmlWebpackPlugin = require("html-webpack-plugin");
2+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3+
const webpack = require("webpack");
4+
const path = require("path");
55

6-
var basePath = __dirname;
6+
const basePath = __dirname;
77

88
module.exports = {
99
context: path.join(basePath, "src"),
1010
resolve: {
11-
extensions: [".js", ".ts", ".tsx"]
11+
extensions: [".js", ".ts", ".tsx"],
1212
},
1313
entry: ["@babel/polyfill", "./index.tsx"],
1414
output: {
1515
path: path.join(basePath, "dist"),
16-
filename: "bundle.js"
16+
filename: "bundle.js",
1717
},
1818
devtool: "source-map",
1919
devServer: {
2020
contentBase: "./dist", // Content base
2121
inline: true, // Enable watch and live reload
2222
host: "localhost",
2323
port: 8080,
24-
stats: "errors-only"
24+
stats: "errors-only",
2525
},
2626
module: {
2727
rules: [
@@ -31,32 +31,33 @@ module.exports = {
3131
loader: "awesome-typescript-loader",
3232
options: {
3333
useBabel: true,
34-
babelCore: "@babel/core" // needed for Babel v7
35-
}
34+
babelCore: "@babel/core", // needed for Babel v7
35+
},
3636
},
3737
{
3838
test: /\.css$/,
39-
use: [MiniCssExtractPlugin.loader, "css-loader"]
39+
use: [MiniCssExtractPlugin.loader, "css-loader"],
4040
},
4141
{
4242
test: /\.(png|jpg|gif|svg)$/,
4343
loader: "file-loader",
4444
options: {
45-
name: "assets/img/[name].[ext]?[hash]"
46-
}
47-
}
48-
]
45+
name: "assets/img/[name].[ext]?[hash]",
46+
esModule: false,
47+
},
48+
},
49+
],
4950
},
5051
plugins: [
5152
//Generate index.html in /dist => https://github.com/ampedandwired/html-webpack-plugin
5253
new HtmlWebpackPlugin({
5354
filename: "index.html", //Name of file in ./dist/
5455
template: "index.html", //Name of template in ./src
55-
hash: true
56+
hash: true,
5657
}),
5758
new MiniCssExtractPlugin({
5859
filename: "[name].css",
59-
chunkFilename: "[id].css"
60-
})
61-
]
60+
chunkFilename: "[id].css",
61+
}),
62+
],
6263
};

hooks/04_Callback/package.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@
1515
"author": "Braulio Diez Botella",
1616
"license": "MIT",
1717
"devDependencies": {
18-
"@babel/cli": "^7.2.3",
19-
"@babel/core": "^7.2.2",
20-
"@babel/polyfill": "^7.2.5",
21-
"@babel/preset-env": "^7.3.1",
22-
"@types/react": "^16.8.3",
23-
"@types/react-dom": "^16.8.1",
18+
"@babel/cli": "^7.10.5",
19+
"@babel/core": "^7.10.5",
20+
"@babel/polyfill": "^7.10.4",
21+
"@babel/preset-env": "^7.10.4",
22+
"@types/react": "^16.9.43",
23+
"@types/react-dom": "^16.9.8",
2424
"awesome-typescript-loader": "^5.2.1",
25-
"babel-loader": "^8.0.5",
26-
"css-loader": "^2.1.0",
27-
"file-loader": "^3.0.1",
28-
"html-webpack-plugin": "^3.2.0",
29-
"mini-css-extract-plugin": "^0.5.0",
30-
"style-loader": "^0.23.1",
31-
"typescript": "^3.3.3",
32-
"url-loader": "^1.1.2",
33-
"webpack": "^4.29.3",
34-
"webpack-cli": "^3.2.3",
35-
"webpack-dev-server": "^3.1.14"
25+
"babel-loader": "^8.1.0",
26+
"css-loader": "^3.6.0",
27+
"file-loader": "^6.0.0",
28+
"html-webpack-plugin": "^4.3.0",
29+
"mini-css-extract-plugin": "^0.9.0",
30+
"style-loader": "^1.2.1",
31+
"typescript": "^3.9.7",
32+
"url-loader": "^4.1.0",
33+
"webpack": "^4.43.0",
34+
"webpack-cli": "^3.3.12",
35+
"webpack-dev-server": "^3.11.0"
3636
},
3737
"dependencies": {
38-
"react": "^16.8.2",
39-
"react-dom": "^16.8.2"
38+
"react": "^16.13.1",
39+
"react-dom": "^16.13.1"
4040
}
4141
}

hooks/04_Callback/webpack.config.js

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
var HtmlWebpackPlugin = require("html-webpack-plugin");
2-
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
3-
var webpack = require("webpack");
4-
var path = require("path");
1+
const HtmlWebpackPlugin = require("html-webpack-plugin");
2+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3+
const webpack = require("webpack");
4+
const path = require("path");
55

6-
var basePath = __dirname;
6+
const basePath = __dirname;
77

88
module.exports = {
99
context: path.join(basePath, "src"),
1010
resolve: {
11-
extensions: [".js", ".ts", ".tsx"]
11+
extensions: [".js", ".ts", ".tsx"],
1212
},
1313
entry: ["@babel/polyfill", "./index.tsx"],
1414
output: {
1515
path: path.join(basePath, "dist"),
16-
filename: "bundle.js"
16+
filename: "bundle.js",
1717
},
1818
devtool: "source-map",
1919
devServer: {
2020
contentBase: "./dist", // Content base
2121
inline: true, // Enable watch and live reload
2222
host: "localhost",
2323
port: 8080,
24-
stats: "errors-only"
24+
stats: "errors-only",
2525
},
2626
module: {
2727
rules: [
@@ -31,32 +31,33 @@ module.exports = {
3131
loader: "awesome-typescript-loader",
3232
options: {
3333
useBabel: true,
34-
babelCore: "@babel/core" // needed for Babel v7
35-
}
34+
babelCore: "@babel/core", // needed for Babel v7
35+
},
3636
},
3737
{
3838
test: /\.css$/,
39-
use: [MiniCssExtractPlugin.loader, "css-loader"]
39+
use: [MiniCssExtractPlugin.loader, "css-loader"],
4040
},
4141
{
4242
test: /\.(png|jpg|gif|svg)$/,
4343
loader: "file-loader",
4444
options: {
45-
name: "assets/img/[name].[ext]?[hash]"
46-
}
47-
}
48-
]
45+
name: "assets/img/[name].[ext]?[hash]",
46+
esModule: false,
47+
},
48+
},
49+
],
4950
},
5051
plugins: [
5152
//Generate index.html in /dist => https://github.com/ampedandwired/html-webpack-plugin
5253
new HtmlWebpackPlugin({
5354
filename: "index.html", //Name of file in ./dist/
5455
template: "index.html", //Name of template in ./src
55-
hash: true
56+
hash: true,
5657
}),
5758
new MiniCssExtractPlugin({
5859
filename: "[name].css",
59-
chunkFilename: "[id].css"
60-
})
61-
]
60+
chunkFilename: "[id].css",
61+
}),
62+
],
6263
};

0 commit comments

Comments
 (0)