Skip to content

Commit 83e1028

Browse files
authored
fix: remove lodash-es (#303)
* refactor: Remove use of lodash.pick() * chore: Remove unused lodash-es package * Create curvy-starfishes-beam.md
1 parent 6132bed commit 83e1028

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

.changeset/curvy-starfishes-beam.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"vite-plugin-checker": patch
3+
---
4+
5+
Remove lodash-es from dependencies

packages/vite-plugin-checker/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"commander": "^8.0.0",
4747
"fast-glob": "^3.2.7",
4848
"fs-extra": "^11.1.0",
49-
"lodash-es": "^4.17.21",
5049
"npm-run-path": "^4.0.1",
5150
"semver": "^7.5.0",
5251
"strip-ansi": "^6.0.0",
@@ -96,7 +95,6 @@
9695
"devDependencies": {
9796
"@types/eslint": "^7.2.14",
9897
"@types/fs-extra": "^11.0.1",
99-
"@types/lodash-es": "^4.17.12",
10098
"@types/semver": "^7.3.13",
10199
"@volar/vue-typescript": "^0.33.0",
102100
"esbuild": "^0.14.27",

packages/vite-plugin-checker/src/main.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import chalk from 'chalk'
22
import { spawn } from 'child_process'
3-
import { pick } from 'lodash-es'
43
import npmRunPath from 'npm-run-path'
54

65
import { Checker } from './Checker.js'
@@ -21,12 +20,10 @@ import {
2120
type Action,
2221
type PluginConfig,
2322
type ServeAndBuildChecker,
24-
type SharedConfig,
2523
type UserPluginConfig,
2624
} from './types.js'
2725
import type { ConfigEnv, Plugin, Logger } from 'vite'
2826

29-
const sharedConfigKeys: (keyof SharedConfig)[] = ['enableBuild', 'overlay']
3027
const buildInCheckerKeys: BuildInCheckerNames[] = [
3128
'typescript',
3229
'vueTsc',
@@ -40,7 +37,8 @@ async function createCheckers(
4037
env: ConfigEnv
4138
): Promise<ServeAndBuildChecker[]> {
4239
const serveAndBuildCheckers: ServeAndBuildChecker[] = []
43-
const sharedConfig = pick(userConfig, sharedConfigKeys)
40+
const { enableBuild, overlay } = userConfig
41+
const sharedConfig = { enableBuild, overlay }
4442

4543
// buildInCheckerKeys.forEach(async (name: BuildInCheckerNames) => {
4644
for (const name of buildInCheckerKeys) {

pnpm-lock.yaml

-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)