From b8604736986494f50e1d800bb770b0696de934b6 Mon Sep 17 00:00:00 2001 From: jialin Date: Fri, 14 Jun 2024 19:31:16 +0800 Subject: [PATCH] build: add sensitive plugin --- config/config.ts | 7 ++++++ package.json | 2 ++ pnpm-lock.yaml | 59 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/config/config.ts b/config/config.ts index 1c564aba..34272a4f 100644 --- a/config/config.ts +++ b/config/config.ts @@ -1,9 +1,16 @@ import { defineConfig } from '@umijs/max'; +const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); + import proxy from './proxy'; import routes from './routes'; export default defineConfig({ + chainWebpack(config) { + config + .plugin('case-sensitive-paths-webpack-plugin') + .use(CaseSensitivePathsPlugin); + }, proxy: { ...proxy() }, diff --git a/package.json b/package.json index 71d47124..2364641d 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,8 @@ "devDependencies": { "@types/react": "^18.3.1", "@types/react-dom": "^18.3.0", + "@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1", + "case-sensitive-paths-webpack-plugin": "^2.4.0", "eslint": "^8.56.0", "eslint-plugin-unused-imports": "^3.2.0", "husky": "^9.0.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 958dc6a8..8aaceb2e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,6 +58,12 @@ devDependencies: '@types/react-dom': specifier: ^18.3.0 version: 18.3.0 + '@umijs/case-sensitive-paths-webpack-plugin': + specifier: ^1.0.1 + version: 1.0.1 + case-sensitive-paths-webpack-plugin: + specifier: ^2.4.0 + version: 2.4.0 eslint: specifier: ^8.56.0 version: 8.56.0 @@ -4699,7 +4705,7 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@7.32.0)(typescript@4.9.5) '@typescript-eslint/utils': 5.62.0(eslint@7.32.0)(typescript@4.9.5) @@ -4727,7 +4733,7 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.4.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.35.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/type-utils': 5.62.0(eslint@8.35.0)(typescript@5.4.5) '@typescript-eslint/utils': 5.62.0(eslint@8.35.0)(typescript@5.4.5) @@ -4789,7 +4795,7 @@ packages: - typescript dev: false - /@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@4.9.5): + /@typescript-eslint/parser@5.62.0(eslint@8.35.0)(typescript@5.4.5): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4801,10 +4807,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5) debug: 4.3.4 - eslint: 7.32.0 - typescript: 4.9.5 + eslint: 8.35.0 + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false @@ -5193,8 +5199,7 @@ packages: dev: false /@umijs/case-sensitive-paths-webpack-plugin@1.0.1: - resolution: {integrity: sha512-kDKJ8yTarxwxGJDInG33hOpaQRZ//XpNuuznQ/1Mscypw6kappzFmrBr2dOYave++K7JHouoANF354UpbEQw0Q==} - dev: false + resolution: {integrity: sha512-kDKJ8yTarxwxGJDInG33hOpaQRZ//XpNuuznQ/1Mscypw6kappzFmrBr2dOYave++K7JHouoANF354UpbEQw0Q==, tarball: https://registry.npmjs.org/@umijs/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-1.0.1.tgz} /@umijs/core@4.2.1: resolution: {integrity: sha512-zfY3N2/18xW/2M/mGzvk6msq1KtcJywCLRiLsbIDeQOGlFFWxseqeKmrPkH4xmDkvR7zDpKpDeTtoNCGieYzyg==} @@ -5321,7 +5326,7 @@ packages: '@babel/preset-react': 7.24.7(@babel/core@7.24.5) '@babel/preset-typescript': 7.24.7(@babel/core@7.24.5) '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@7.32.0)(typescript@4.9.5) - '@typescript-eslint/parser': 5.62.0(eslint@7.32.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.4.5) chalk: 4.1.2 eslint: 7.32.0 eslint-config-prettier: 8.10.0(eslint@7.32.0) @@ -5363,7 +5368,7 @@ packages: '@babel/eslint-parser': 7.23.3(@babel/core@7.23.6)(eslint@8.35.0) '@stylelint/postcss-css-in-js': 0.38.0(postcss-syntax@0.36.2)(postcss@8.4.38) '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.35.0)(typescript@5.4.5) - '@typescript-eslint/parser': 5.62.0(eslint@8.56.0)(typescript@5.4.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.35.0)(typescript@5.4.5) '@umijs/babel-preset-umi': 4.2.1 eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.35.0)(typescript@5.4.5) eslint-plugin-react: 7.33.2(eslint@8.35.0) @@ -5384,7 +5389,7 @@ packages: - typescript dev: false - /@umijs/lint@4.2.1(eslint@8.56.0)(stylelint@14.8.2)(typescript@5.4.5): + /@umijs/lint@4.2.1(eslint@8.56.0)(stylelint@13.13.1)(typescript@5.4.5): resolution: {integrity: sha512-SXa4c6n8qfMfOadw1lFB97Tl/ILChALXEkkzmqwuOS31rW82vL2Iq6ewCGcydW6+JZSe6DybgzswV0pBGn6s/w==} dependencies: '@babel/core': 7.23.6 @@ -5398,7 +5403,7 @@ packages: eslint-plugin-react-hooks: 4.6.0(eslint@8.56.0) postcss: 8.4.38 postcss-syntax: 0.36.2(postcss@8.4.38) - stylelint-config-standard: 25.0.0(stylelint@14.8.2) + stylelint-config-standard: 25.0.0(stylelint@13.13.1) transitivePeerDependencies: - eslint - jest @@ -5848,7 +5853,7 @@ packages: express: 4.19.2 lodash: 4.17.21 prettier: 2.8.8 - umi: 4.2.1(@babel/core@7.24.5)(@types/react@18.3.1)(eslint@8.56.0)(prettier@3.2.5)(react-dom@18.3.1)(react@18.3.1)(stylelint@14.8.2)(typescript@5.4.5)(webpack@5.91.0) + umi: 4.2.1(@babel/core@7.24.5)(@types/react@18.3.1)(eslint@8.56.0)(prettier@3.2.5)(react-dom@18.3.1)(react@18.3.1)(stylelint@13.13.1)(typescript@5.4.5)(webpack@5.91.0) transitivePeerDependencies: - supports-color dev: false @@ -7034,6 +7039,11 @@ packages: resolution: {integrity: sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA==} dev: false + /case-sensitive-paths-webpack-plugin@2.4.0: + resolution: {integrity: sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==, tarball: https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz} + engines: {node: '>=4'} + dev: true + /center-align@0.1.3: resolution: {integrity: sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==} engines: {node: '>=0.10.0'} @@ -15302,7 +15312,7 @@ packages: dev: false /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, tarball: https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz} engines: {node: '>=0.10.0'} dev: false @@ -15621,6 +15631,14 @@ packages: stylelint: 13.13.1 dev: false + /stylelint-config-recommended@7.0.0(stylelint@13.13.1): + resolution: {integrity: sha512-yGn84Bf/q41J4luis1AZ95gj0EQwRX8lWmGmBwkwBNSkpGSpl66XcPTulxGa/Z91aPoNGuIGBmFkcM1MejMo9Q==} + peerDependencies: + stylelint: ^14.4.0 + dependencies: + stylelint: 13.13.1 + dev: false + /stylelint-config-recommended@7.0.0(stylelint@14.8.2): resolution: {integrity: sha512-yGn84Bf/q41J4luis1AZ95gj0EQwRX8lWmGmBwkwBNSkpGSpl66XcPTulxGa/Z91aPoNGuIGBmFkcM1MejMo9Q==} peerDependencies: @@ -15638,6 +15656,15 @@ packages: stylelint-config-recommended: 3.0.0(stylelint@13.13.1) dev: false + /stylelint-config-standard@25.0.0(stylelint@13.13.1): + resolution: {integrity: sha512-21HnP3VSpaT1wFjFvv9VjvOGDtAviv47uTp3uFmzcN+3Lt+RYRv6oAplLaV51Kf792JSxJ6svCJh/G18E9VnCA==} + peerDependencies: + stylelint: ^14.4.0 + dependencies: + stylelint: 13.13.1 + stylelint-config-recommended: 7.0.0(stylelint@13.13.1) + dev: false + /stylelint-config-standard@25.0.0(stylelint@14.8.2): resolution: {integrity: sha512-21HnP3VSpaT1wFjFvv9VjvOGDtAviv47uTp3uFmzcN+3Lt+RYRv6oAplLaV51Kf792JSxJ6svCJh/G18E9VnCA==} peerDependencies: @@ -16348,7 +16375,7 @@ packages: - webpack-plugin-serve dev: false - /umi@4.2.1(@babel/core@7.24.5)(@types/react@18.3.1)(eslint@8.56.0)(prettier@3.2.5)(react-dom@18.3.1)(react@18.3.1)(stylelint@14.8.2)(typescript@5.4.5)(webpack@5.91.0): + /umi@4.2.1(@babel/core@7.24.5)(@types/react@18.3.1)(eslint@8.56.0)(prettier@3.2.5)(react-dom@18.3.1)(react@18.3.1)(stylelint@13.13.1)(typescript@5.4.5)(webpack@5.91.0): resolution: {integrity: sha512-qbzSLODLBhtUWiSp/ewMKqa++oeuN/QIn6WZSbV2hiD6uEpKDQ6Ru6gIYxivbmcYsxSigo7wpH3LRDNGcs581g==} engines: {node: '>=14'} hasBin: true @@ -16357,7 +16384,7 @@ packages: '@umijs/bundler-utils': 4.2.1 '@umijs/bundler-webpack': 4.2.1(typescript@5.4.5)(webpack@5.91.0) '@umijs/core': 4.2.1 - '@umijs/lint': 4.2.1(eslint@8.56.0)(stylelint@14.8.2)(typescript@5.4.5) + '@umijs/lint': 4.2.1(eslint@8.56.0)(stylelint@13.13.1)(typescript@5.4.5) '@umijs/preset-umi': 4.2.1(@types/react@18.3.1)(typescript@5.4.5)(webpack@5.91.0) '@umijs/renderer-react': 4.2.1(react-dom@18.3.1)(react@18.3.1) '@umijs/server': 4.2.1