Skip to content

Commit

Permalink
chore: remove unnecessary dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Nov 26, 2021
1 parent c6ad05f commit b0c3677
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -63,15 +63,13 @@
"consola": "^2.15.3",
"flat": "^5.0.2",
"fs-extra": "^9.1.0",
"jju": "^1.4.0",
"postcss": "^8.2.10",
"postcss-simple-vars": "^6.0.3",
"prettier": "^2.2.1",
"resolve": "^1.20.0",
"rollup-plugin-dts": "^3.0.2",
"rollup-plugin-hashbang": "^2.2.2",
"string-argv": "^0.3.1",
"strip-json-comments": "^3.1.1",
"svelte": "3.37.0",
"ts-essentials": "^7.0.1",
"tsconfig-paths": "^3.12.0",
Expand Down
13 changes: 0 additions & 13 deletions pnpm-lock.yaml

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

9 changes: 2 additions & 7 deletions src/load.ts
@@ -1,19 +1,14 @@
import fs from 'fs'
import { parse as parseJson } from 'jju/lib/parse'
import JoyCon from 'joycon'
import path from 'path'
import { bundleRequire } from 'bundle-require'
import stripJsonComments from 'strip-json-comments'
import { bundleRequire, jsoncParse } from 'bundle-require'
import { defineConfig } from './'

const joycon = new JoyCon()

const loadJson = async (filepath: string) => {
try {
const content = stripJsonComments(
await fs.promises.readFile(filepath, 'utf8')
)
return parseJson(content)
return jsoncParse(await fs.promises.readFile(filepath, 'utf8'))
} catch (error: any) {
throw new Error(
`Failed to parse ${path.relative(process.cwd(), filepath)}: ${
Expand Down

0 comments on commit b0c3677

Please sign in to comment.