Skip to content

Commit 121e503

Browse files
committed
1.0.7
* Fixed css import error * Dropped devServer host,port properties * Removed is-windows dev dependency * Added default *.json declaration * Removed husky due to simple-git-hooks * Bump dependencies
1 parent d166c3a commit 121e503

File tree

11 files changed

+58
-50
lines changed

11 files changed

+58
-50
lines changed

package.json

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-typescript-react",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Webpack 5 boilerplate with support of most common loaders and modules",
55
"keywords": [
66
"react",
@@ -22,89 +22,85 @@
2222
"start": "cross-env WEBPACK_IS_DEV_SERVER=true NODE_ENV=development webpack serve --config webpack.config.babel.js",
2323
"release": "npm version patch"
2424
},
25-
"husky": {
26-
"hooks": {
27-
"pre-commit": "lint-staged",
28-
"post-commit": "git update-index --again"
29-
}
25+
"simple-git-hooks": {
26+
"pre-commit": "npx lint-staged",
27+
"post-commit": "git update-index --again"
3028
},
3129
"dependencies": {
3230
"@types/classnames": "^2.3.0",
33-
"@types/react": "^17.0.37",
31+
"@types/react": "^17.0.38",
3432
"@types/react-dom": "^17.0.11",
3533
"classnames": "^2.3.1",
3634
"normalize.css": "^8.0.1",
3735
"react": "^17.0.2",
3836
"react-dom": "^17.0.2"
3937
},
4038
"devDependencies": {
41-
"@babel/core": "~7.16.0",
42-
"@babel/plugin-proposal-class-properties": "~7.16.0",
43-
"@babel/plugin-proposal-export-default-from": "^7.16.0",
44-
"@babel/plugin-proposal-export-namespace-from": "~7.16.0",
45-
"@babel/plugin-proposal-object-rest-spread": "~7.16.0",
46-
"@babel/plugin-proposal-throw-expressions": "~7.16.0",
39+
"@babel/core": "~7.16.7",
40+
"@babel/plugin-proposal-class-properties": "~7.16.7",
41+
"@babel/plugin-proposal-export-default-from": "^7.16.7",
42+
"@babel/plugin-proposal-export-namespace-from": "~7.16.7",
43+
"@babel/plugin-proposal-object-rest-spread": "~7.16.7",
44+
"@babel/plugin-proposal-throw-expressions": "~7.16.7",
4745
"@babel/plugin-syntax-dynamic-import": "~7.8.3",
48-
"@babel/plugin-transform-runtime": "~7.16.4",
49-
"@babel/preset-env": "~7.16.4",
50-
"@babel/preset-react": "~7.16.0",
51-
"@babel/register": "~7.16.0",
52-
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.3",
46+
"@babel/plugin-transform-runtime": "~7.16.7",
47+
"@babel/preset-env": "~7.16.7",
48+
"@babel/preset-react": "~7.16.7",
49+
"@babel/register": "~7.16.7",
50+
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.4",
5351
"@svgr/webpack": "~6.1.2",
5452
"@teamsupercell/typings-for-css-modules-loader": "~2.5.1",
55-
"@typescript-eslint/eslint-plugin": "~5.6.0",
56-
"@typescript-eslint/parser": "~5.6.0",
57-
"autoprefixer": "~10.4.0",
53+
"@typescript-eslint/eslint-plugin": "~5.9.0",
54+
"@typescript-eslint/parser": "~5.9.0",
55+
"autoprefixer": "~10.4.2",
5856
"babel-eslint": "~10.1.0",
5957
"babel-loader": "~8.2.3",
6058
"clean-webpack-plugin": "~4.0.0",
61-
"copy-webpack-plugin": "~10.1.0",
62-
"core-js": "~3.19.3",
59+
"copy-webpack-plugin": "~10.2.0",
60+
"core-js": "~3.20.2",
6361
"cross-env": "^7.0.3",
6462
"css-loader": "~6.5.1",
65-
"cssnano": "~5.0.12",
66-
"eslint": "~8.4.1",
63+
"cssnano": "~5.0.15",
64+
"eslint": "~8.6.0",
6765
"eslint-config-airbnb-base": "~15.0.0",
6866
"eslint-config-airbnb-typescript": "~16.1.0",
6967
"eslint-config-prettier": "~8.3.0",
7068
"eslint-import-resolver-alias": "~1.1.2",
71-
"eslint-plugin-import": "~2.25.3",
69+
"eslint-plugin-import": "~2.25.4",
7270
"eslint-plugin-jsx-a11y": "~6.5.1",
73-
"eslint-plugin-react": "~7.27.1",
71+
"eslint-plugin-react": "~7.28.0",
7472
"eslint-plugin-react-hooks": "~4.3.0",
7573
"eslint-webpack-plugin": "~3.1.1",
7674
"fork-ts-checker-webpack-plugin": "~6.5.0",
77-
"html-loader": "~3.0.1",
75+
"html-loader": "~3.1.0",
7876
"html-webpack-plugin": "~5.5.0",
79-
"husky": "~7.0.4",
8077
"import-sort-style-module-and-prefix": "~0.1.3",
81-
"is-windows": "~1.0.2",
8278
"less": "~4.1.2",
8379
"less-loader": "~10.2.0",
84-
"lint-staged": "~12.1.2",
85-
"mini-css-extract-plugin": "~2.4.5",
80+
"mini-css-extract-plugin": "~2.4.6",
8681
"path": "~0.12.7",
8782
"postcss": "~8.4.5",
8883
"postcss-loader": "~6.2.1",
8984
"prettier": "~2.5.1",
9085
"prettier-plugin-import-sort": "~0.0.7",
91-
"pretty-quick": "~3.1.2",
86+
"pretty-quick": "~3.1.3",
9287
"react-refresh": "~0.11.0",
9388
"regenerator-runtime": "~0.13.9",
9489
"resolve-url-loader": "~4.0.0",
95-
"sass": "~1.45.0",
90+
"sass": "~1.47.0",
9691
"sass-loader": "~12.4.0",
9792
"sass-resources-loader": "~2.2.4",
93+
"simple-git-hooks": "^2.7.0",
9894
"style-loader": "~3.3.1",
9995
"svg-url-loader": "~7.1.1",
100-
"terser-webpack-plugin": "~5.2.5",
96+
"terser-webpack-plugin": "~5.3.0",
10197
"ts-loader": "~9.2.6",
102-
"typescript": "~4.5.3",
98+
"typescript": "~4.5.4",
10399
"url-loader": "~4.1.1",
104100
"webpack": "~5.65.0",
105101
"webpack-bundle-analyzer": "~4.5.0",
106102
"webpack-cli": "~4.9.1",
107-
"webpack-dev-server": "~4.6.0",
103+
"webpack-dev-server": "~4.7.2",
108104
"webpack-merge": "~5.8.0"
109105
},
110106
"importSort": {

src/@types/declarations.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ declare module "*.svg" {
1414
export default ReactComponent;
1515
}
1616

17+
declare module '*.json' {
18+
const content: Record<string, string>;
19+
export default content;
20+
}
21+
22+
1723
declare const IS_PROD: boolean;
1824
declare const IS_DEV: boolean;
1925
declare const IS_DEV_SERVER: boolean;

src/components/app/app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import cn from 'classnames';
66
import React, {Suspense, lazy} from 'react';
77

8+
import packageJson from '../../../package.json';
89
import {stylesContainer} from './app.module.less';
910
import {stylesHeader, stylesImage, stylesLink} from './app.module.scss';
1011

@@ -21,7 +22,7 @@ export const App = (): React.ReactElement => (
2122
href="https://github.com/glook/webpack-typescript-react"
2223
target="_blank"
2324
>
24-
@glook/webpack-typescript-react
25+
@glook/webpack-typescript-react ({packageJson.version})
2526
</a>
2627
</div>
2728
</div>

src/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, maximum-scale=1.5, minimum-scale=0.9, user-scalable=yes"
8+
/>
59
<title>Webpack5 typescript react boilerplate</title>
10+
<link rel="preconnect" href="https://fonts.googleapis.com" />
11+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
612
<link
7-
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@600;400&display=swap"
13+
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap"
814
rel="stylesheet"
915
/>
1016
</head>

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '@styles/styles.css';
12
/**
23
* Created by: Andrey Polyakov (andrey@polyakov.im)
34
*/

src/styles/styles.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#root {
2+
background: #fff;
3+
}

webpack/base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import path from 'path';
55

6-
import {aliasItems, devServerUrl, externalItems} from './config';
6+
import {aliasItems, externalItems} from './config';
77
import entry from './entry';
88
import optimization from './optimization';
99
import * as plugins from './plugins';
@@ -18,7 +18,7 @@ export default {
1818
entry,
1919
output: {
2020
path: path.join(__dirname, '../dist'),
21-
publicPath: isDevServer ? devServerUrl : './',
21+
publicPath: isDevServer ? undefined : './',
2222
filename: isDevServer
2323
? '[name].[fullhash].js'
2424
: '[name].[contenthash].js',

webpack/config/devServer.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@
33
* @see https://webpack.js.org/configuration/dev-server/
44
*/
55

6-
import {defaultPort, devServerHost} from '../utils/env';
76
import {devServerProxyConfig} from './devServierProxy';
87

9-
export const devServerUrl = `http://${devServerHost}:${defaultPort}/`;
10-
118
export const devServerConfig = {
129
client: {
1310
overlay: false,
1411
},
1512
headers: {'Access-Control-Allow-Origin': '*'},
1613
historyApiFallback: true,
17-
host: devServerHost,
1814
hot: true,
19-
port: defaultPort,
2015
proxy: devServerProxyConfig,
2116
static: {
2217
publicPath: '/',

webpack/config/devServierProxy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const httpsProxyTarget = {
1515
};
1616

1717
export const devServerProxyConfig = {
18+
/*
19+
// Example proxy configuration endpoins
1820
'/world-time': {
1921
target: `${httpsProxyTarget.protocol}://worldtimeapi.org:${httpsProxyTarget.port}`,
2022
pathRewrite: pathRewrite('^/world-time/test', '/api'),
@@ -27,4 +29,5 @@ export const devServerProxyConfig = {
2729
changeOrigin: true,
2830
secure: false,
2931
},
32+
*/
3033
};

webpack/rules/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
/** css **/
1717
export const cssRule = {
1818
test: /\.css$/,
19-
use: [miniCssExtractLoader, postCssLoader, resolveUrlLoader, cssLoader],
19+
use: [miniCssExtractLoader, cssLoader, postCssLoader],
2020
};
2121

2222
/** less **/

0 commit comments

Comments
 (0)