Skip to content

Commit b52e503

Browse files
committed
chore: weaken lint rules, minify build
1 parent 694de1e commit b52e503

File tree

5 files changed

+66
-16
lines changed

5 files changed

+66
-16
lines changed

examples/webpack.config.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import * as path from 'path';
22
import * as webpack from 'webpack';
33
import HtmlWebpackPlugin from 'html-webpack-plugin';
44
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
5-
import BundleAnalyzerPlugin from 'webpack-bundle-analyzer';
6-
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
5+
// import BundleAnalyzerPlugin from 'webpack-bundle-analyzer';
76

87
const config: webpack.Configuration = {
98
mode: 'development',
109
entry: './src/index.tsx',
1110
devtool: 'eval-source-map',
1211
plugins: [
13-
new BundleAnalyzerPlugin.BundleAnalyzerPlugin(),
12+
// new BundleAnalyzerPlugin.BundleAnalyzerPlugin(),
1413
new HtmlWebpackPlugin({
1514
template: './index.html',
1615
}),

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
],
2222
"type": "module",
2323
"scripts": {
24-
"build": "tsc && vite build",
24+
"dev": "yarn vite build --mode development --watch",
25+
"build": "yarn vite build --mode production --minify",
2526
"lint": "eslint . --ext ts,tsx",
2627
"lint:fix": "eslint . --ext ts,tsx --fix",
2728
"format": "prettier --check .",
@@ -55,6 +56,7 @@
5556
"@storybook/blocks": "8.6.3",
5657
"@testing-library/react": "16.2.0",
5758
"@types/node": "22.13.8",
59+
"@types/react": "^19.0.10",
5860
"@vitejs/plugin-react": "4.3.4",
5961
"@vitejs/plugin-react-swc": "^3.8.0",
6062
"@vitest/coverage-v8": "3.0.7",
@@ -70,21 +72,21 @@
7072
"globals": "16.0.0",
7173
"jsdom": "26.0.0",
7274
"prettier": "3.5.2",
75+
"react": "^18.2.0",
76+
"react-dom": "^18.2.0",
7377
"react-test-renderer": "^18.2.0",
7478
"sass-embedded": "^1.85.1",
7579
"storybook": "8.6.3",
7680
"stylelint": "16.15.0",
7781
"stylelint-config-standard": "37.0.0",
82+
"terser": "^5.39.0",
7883
"typescript": "5.7.3",
7984
"typescript-eslint": "8.25.0",
8085
"vite": "6.2.0",
8186
"vite-plugin-css-injected-by-js": "^3.5.2",
8287
"vite-plugin-dts": "4.5.1",
8388
"vite-plugin-externals": "^0.6.2",
8489
"vite-plugin-lib-inject-css": "2.2.1",
85-
"vitest": "3.0.7",
86-
"react": "^18.2.0",
87-
"react-dom": "^18.2.0"
88-
90+
"vitest": "3.0.7"
8991
}
9092
}

tsconfig.app.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
/* Linting */
1919
"strict": true,
20-
"noUnusedLocals": true,
21-
"noUnusedParameters": true,
20+
"noUnusedLocals": false,
21+
"noUnusedParameters": false,
2222
"noFallthroughCasesInSwitch": true,
2323
"noUncheckedSideEffectImports": true,
2424
"allowSyntheticDefaultImports": true

vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535
},
3636
},
3737
build: {
38+
minify: 'terser',
3839
lib: {
3940
entry: resolve(__dirname, 'src/index.ts'),
4041
formats: ['es'],

yarn.lock

+54-6
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,14 @@
560560
resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280"
561561
integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==
562562

563+
"@jridgewell/source-map@^0.3.3":
564+
version "0.3.6"
565+
resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a"
566+
integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==
567+
dependencies:
568+
"@jridgewell/gen-mapping" "^0.3.5"
569+
"@jridgewell/trace-mapping" "^0.3.25"
570+
563571
"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0":
564572
version "1.5.0"
565573
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a"
@@ -1267,6 +1275,13 @@
12671275
dependencies:
12681276
undici-types "~6.20.0"
12691277

1278+
"@types/react@^19.0.10":
1279+
version "19.0.10"
1280+
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.10.tgz#d0c66dafd862474190fe95ce11a68de69ed2b0eb"
1281+
integrity sha512-JuRQ9KXLEjaUNjTWpzuR231Z2WpIwczOkBEIvbHNCzQefFIT0L8IqE6NV6ULLyC1SI/i234JnDoMkfg+RjQj2g==
1282+
dependencies:
1283+
csstype "^3.0.2"
1284+
12701285
"@types/unist@*", "@types/unist@^3.0.0":
12711286
version "3.0.3"
12721287
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c"
@@ -1643,7 +1658,7 @@ acorn-jsx@^5.0.0, acorn-jsx@^5.3.2:
16431658
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
16441659
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
16451660

1646-
acorn@^8.0.0, acorn@^8.14.0, acorn@^8.4.0:
1661+
acorn@^8.0.0, acorn@^8.14.0, acorn@^8.4.0, acorn@^8.8.2:
16471662
version "8.14.1"
16481663
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.1.tgz#721d5dc10f7d5b5609a891773d47731796935dfb"
16491664
integrity sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==
@@ -1881,6 +1896,11 @@ buffer-builder@^0.2.0:
18811896
resolved "https://registry.yarnpkg.com/buffer-builder/-/buffer-builder-0.2.0.tgz#3322cd307d8296dab1f604618593b261a3fade8f"
18821897
integrity sha512-7VPMEPuYznPSoR21NE1zvd2Xna6c/CloiZCfcMXR1Jny6PjX0N4Nsa38zcBFo/FMK+BlA+FLKbJCQ0i2yxp+Xg==
18831898

1899+
buffer-from@^1.0.0:
1900+
version "1.1.2"
1901+
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
1902+
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
1903+
18841904
buffer@^6.0.3:
18851905
version "6.0.3"
18861906
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
@@ -2044,6 +2064,11 @@ comma-separated-tokens@^2.0.0:
20442064
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"
20452065
integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
20462066

2067+
commander@^2.20.0:
2068+
version "2.20.3"
2069+
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
2070+
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
2071+
20472072
compare-versions@^6.1.1:
20482073
version "6.1.1"
20492074
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.1.tgz#7af3cc1099ba37d244b3145a9af5201b629148a9"
@@ -2119,6 +2144,11 @@ cssstyle@^4.2.1:
21192144
"@asamuzakjp/css-color" "^2.8.2"
21202145
rrweb-cssom "^0.8.0"
21212146

2147+
csstype@^3.0.2:
2148+
version "3.1.3"
2149+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"
2150+
integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
2151+
21222152
data-urls@^5.0.0:
21232153
version "5.0.0"
21242154
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-5.0.0.tgz#2f76906bce1824429ffecb6920f45a0b30f00dde"
@@ -4764,16 +4794,24 @@ source-map-js@^1.0.1, source-map-js@^1.2.0, source-map-js@^1.2.1:
47644794
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
47654795
integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==
47664796

4767-
source-map@^0.7.0:
4768-
version "0.7.4"
4769-
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
4770-
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
4797+
source-map-support@~0.5.20:
4798+
version "0.5.21"
4799+
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
4800+
integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
4801+
dependencies:
4802+
buffer-from "^1.0.0"
4803+
source-map "^0.6.0"
47714804

4772-
source-map@~0.6.1:
4805+
source-map@^0.6.0, source-map@~0.6.1:
47734806
version "0.6.1"
47744807
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
47754808
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
47764809

4810+
source-map@^0.7.0:
4811+
version "0.7.4"
4812+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
4813+
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
4814+
47774815
sourcemap-codec@^1.4.8:
47784816
version "1.4.8"
47794817
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
@@ -4995,6 +5033,16 @@ table@^6.9.0:
49955033
string-width "^4.2.3"
49965034
strip-ansi "^6.0.1"
49975035

5036+
terser@^5.39.0:
5037+
version "5.39.0"
5038+
resolved "https://registry.yarnpkg.com/terser/-/terser-5.39.0.tgz#0e82033ed57b3ddf1f96708d123cca717d86ca3a"
5039+
integrity sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==
5040+
dependencies:
5041+
"@jridgewell/source-map" "^0.3.3"
5042+
acorn "^8.8.2"
5043+
commander "^2.20.0"
5044+
source-map-support "~0.5.20"
5045+
49985046
test-exclude@^7.0.1:
49995047
version "7.0.1"
50005048
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-7.0.1.tgz#20b3ba4906ac20994e275bbcafd68d510264c2a2"

0 commit comments

Comments
 (0)