Skip to content

Commit

Permalink
fix: only return partial config (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding authored Dec 1, 2021
1 parent cdb5f47 commit 6a77d66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { join } from 'path'
import { existsSync, promises as fs } from 'fs'
import _debug from 'debug'
import { mergeConfig } from 'vite'
import type { Plugin } from 'vite'

const debug = _debug('vite-plugin-package-config')
Expand All @@ -27,7 +26,7 @@ function VitePluginPackageConfig(options: Options = {}): Plugin {

return <Plugin>{
name: 'vite-plugin-package-config',
async config(_config) {
async config() {
if (!existsSync(packageJsonPath)) {
debug('package.json not found')
return
Expand All @@ -43,7 +42,7 @@ function VitePluginPackageConfig(options: Options = {}): Plugin {

debug('merging config with')
debug(extend)
return mergeConfig(_config, extend)
return extend;
},
api: {
options: {
Expand Down

0 comments on commit 6a77d66

Please sign in to comment.