json5
This commit is contained in:
parent
9831d3b3e2
commit
3b36a3711c
5 changed files with 15 additions and 3 deletions
|
@ -60,7 +60,7 @@ const escapePathVariables = (value: any) => {
|
|||
}
|
||||
|
||||
function parseJsonFile(path: string) {
|
||||
const JSON5 = require('json5')
|
||||
const JSON5 = require('next/dist/compiled/json5')
|
||||
const contents = readFileSync(path)
|
||||
return JSON5.parse(contents)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import findUp from 'find-up'
|
||||
import fs from 'fs'
|
||||
import JSON5 from 'json5'
|
||||
import JSON5 from 'next/dist/compiled/json5'
|
||||
|
||||
type RecursivePartial<T> = {
|
||||
[P in keyof T]?: RecursivePartial<T[P]>
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
"fork-ts-checker-webpack-plugin": "3.1.1",
|
||||
"ignore-loader": "0.1.2",
|
||||
"jest-worker": "24.9.0",
|
||||
"json5": "2.1.2",
|
||||
"jsonwebtoken": "8.5.1",
|
||||
"launch-editor": "2.2.1",
|
||||
"loader-utils": "2.0.0",
|
||||
|
@ -193,6 +192,7 @@
|
|||
"http-proxy": "1.18.0",
|
||||
"is-docker": "2.0.0",
|
||||
"is-wsl": "2.1.1",
|
||||
"json5": "2.1.2",
|
||||
"nanoid": "2.0.3",
|
||||
"resolve": "1.11.0",
|
||||
"taskr": "1.1.0",
|
||||
|
|
|
@ -363,6 +363,13 @@ export async function ncc_is_wsl(task, opts) {
|
|||
.target('dist/compiled/is-wsl')
|
||||
}
|
||||
// eslint-disable-next-line camelcase
|
||||
export async function ncc_json5(task, opts) {
|
||||
await task
|
||||
.source(opts.src || relative(__dirname, require.resolve('json5')))
|
||||
.ncc({ packageName: 'json5' })
|
||||
.target('dist/compiled/json5')
|
||||
}
|
||||
// eslint-disable-next-line camelcase
|
||||
export async function ncc_nanoid(task, opts) {
|
||||
await task
|
||||
.source(opts.src || relative(__dirname, require.resolve('nanoid')))
|
||||
|
@ -433,6 +440,7 @@ export async function precompile(task) {
|
|||
'ncc_http_proxy',
|
||||
'ncc_is_docker',
|
||||
'ncc_is_wsl',
|
||||
'ncc_json5',
|
||||
'ncc_nanoid',
|
||||
'ncc_resolve',
|
||||
'ncc_text_table',
|
||||
|
|
4
packages/next/types/misc.d.ts
vendored
4
packages/next/types/misc.d.ts
vendored
|
@ -116,6 +116,10 @@ declare module 'next/dist/compiled/is-wsl' {
|
|||
import m from 'is-wsl'
|
||||
export = m
|
||||
}
|
||||
declare module 'next/dist/compiled/json5' {
|
||||
import m from 'json5'
|
||||
export = m
|
||||
}
|
||||
declare module 'next/dist/compiled/nanoid/index.js' {
|
||||
function nanoid(size?: number): string
|
||||
export = nanoid
|
||||
|
|
Loading…
Reference in a new issue