Skip to content

Commit

Permalink
fix: remove lodash-es (#303)
Browse files Browse the repository at this point in the history
* refactor: Remove use of lodash.pick()

* chore: Remove unused lodash-es package

* Create curvy-starfishes-beam.md
  • Loading branch information
nclavaud committed Feb 1, 2024
1 parent 6132bed commit 83e1028
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-starfishes-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vite-plugin-checker": patch
---

Remove lodash-es from dependencies
2 changes: 0 additions & 2 deletions packages/vite-plugin-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"commander": "^8.0.0",
"fast-glob": "^3.2.7",
"fs-extra": "^11.1.0",
"lodash-es": "^4.17.21",
"npm-run-path": "^4.0.1",
"semver": "^7.5.0",
"strip-ansi": "^6.0.0",
Expand Down Expand Up @@ -96,7 +95,6 @@
"devDependencies": {
"@types/eslint": "^7.2.14",
"@types/fs-extra": "^11.0.1",
"@types/lodash-es": "^4.17.12",
"@types/semver": "^7.3.13",
"@volar/vue-typescript": "^0.33.0",
"esbuild": "^0.14.27",
Expand Down
6 changes: 2 additions & 4 deletions packages/vite-plugin-checker/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import chalk from 'chalk'
import { spawn } from 'child_process'
import { pick } from 'lodash-es'
import npmRunPath from 'npm-run-path'

import { Checker } from './Checker.js'
Expand All @@ -21,12 +20,10 @@ import {
type Action,
type PluginConfig,
type ServeAndBuildChecker,
type SharedConfig,
type UserPluginConfig,
} from './types.js'
import type { ConfigEnv, Plugin, Logger } from 'vite'

const sharedConfigKeys: (keyof SharedConfig)[] = ['enableBuild', 'overlay']
const buildInCheckerKeys: BuildInCheckerNames[] = [
'typescript',
'vueTsc',
Expand All @@ -40,7 +37,8 @@ async function createCheckers(
env: ConfigEnv
): Promise<ServeAndBuildChecker[]> {
const serveAndBuildCheckers: ServeAndBuildChecker[] = []
const sharedConfig = pick(userConfig, sharedConfigKeys)
const { enableBuild, overlay } = userConfig
const sharedConfig = { enableBuild, overlay }

// buildInCheckerKeys.forEach(async (name: BuildInCheckerNames) => {
for (const name of buildInCheckerKeys) {
Expand Down
18 changes: 0 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83e1028

Please sign in to comment.