Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' into fix/windows-vite-entry
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Aug 4, 2022
2 parents 2d6fc55 + e3534bc commit 3ddc24b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/kit/src/internal/cjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { interopDefault } from 'mlly'
import jiti from 'jiti'

// TODO: use create-require for jest environment
const _require = jiti(process.cwd(), { interopDefault: true })
const _require = jiti(process.cwd(), { interopDefault: true, esmResolve: true })

export interface ResolveModuleOptions {
paths?: string | string[]
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxi/src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function normalizeConfigModule (module, rootDir) {

function getNuxtConfig (rootDir) {
try {
return jiti(rootDir, { interopDefault: true })('./nuxt.config')
return jiti(rootDir, { interopDefault: true, esmResolve: true })('./nuxt.config')
} catch (err) {
// TODO: Show error as warning if it is not 404
return {}
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/config/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default {
val = process.env.NUXT_CREATE_REQUIRE || val ||
(typeof globalThis.jest !== 'undefined' ? 'native' : 'jiti')
if (val === 'jiti') {
return p => jiti(typeof p === 'string' ? p : p.filename)
return p => jiti(typeof p === 'string' ? p : p.filename, { esmResolve: true })
}
if (val === 'native') {
return p => createRequire(typeof p === 'string' ? p : p.filename)
Expand Down

0 comments on commit 3ddc24b

Please sign in to comment.