diff --git a/package.json b/package.json index bb9b6a8..266e1d5 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ }, "dependencies": { "consola": "^3.2.3", + "mlly": "^1.6.0", "pkg-types": "^1.0.3" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 498d221..be8710e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: consola: specifier: ^3.2.3 version: 3.2.3 + mlly: + specifier: ^1.6.0 + version: 1.6.0 pkg-types: specifier: ^1.0.3 version: 1.0.3 @@ -1413,7 +1416,7 @@ packages: h3: 1.10.0 knitwork: 1.0.0 magic-string: 0.30.5 - mlly: 1.5.0 + mlly: 1.6.0 ohash: 1.1.3 pathe: 1.1.2 perfect-debounce: 1.0.0 @@ -1490,6 +1493,7 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] + libc: [glibc] requiresBuild: true dev: true optional: true @@ -1499,6 +1503,7 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] requiresBuild: true dev: true optional: true @@ -1508,6 +1513,7 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] + libc: [musl] requiresBuild: true dev: true optional: true @@ -1517,6 +1523,7 @@ packages: engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [glibc] requiresBuild: true dev: true optional: true @@ -1526,6 +1533,7 @@ packages: engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] + libc: [musl] requiresBuild: true dev: true optional: true @@ -1879,6 +1887,7 @@ packages: resolution: {integrity: sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==} cpu: [arm64] os: [linux] + libc: [glibc] requiresBuild: true dev: true optional: true @@ -1887,6 +1896,7 @@ packages: resolution: {integrity: sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==} cpu: [arm64] os: [linux] + libc: [musl] requiresBuild: true dev: true optional: true @@ -1895,6 +1905,7 @@ packages: resolution: {integrity: sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==} cpu: [riscv64] os: [linux] + libc: [glibc] requiresBuild: true dev: true optional: true @@ -1903,6 +1914,7 @@ packages: resolution: {integrity: sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==} cpu: [x64] os: [linux] + libc: [glibc] requiresBuild: true dev: true optional: true @@ -1911,6 +1923,7 @@ packages: resolution: {integrity: sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==} cpu: [x64] os: [linux] + libc: [musl] requiresBuild: true dev: true optional: true @@ -2806,7 +2819,7 @@ packages: dotenv: 16.3.2 giget: 1.2.1 jiti: 1.21.0 - mlly: 1.5.0 + mlly: 1.6.0 ohash: 1.1.3 pathe: 1.1.2 perfect-debounce: 1.0.0 @@ -4100,7 +4113,7 @@ packages: resolution: {integrity: sha512-LyExtJWKxtgVzmgtEHyQtLFpw1KFhQphF9nTG8TpAIVkiI/xQ3FJh75tRFLYl4hkn7BNIIdLJInuDAavX35pMw==} dependencies: enhanced-resolve: 5.15.0 - mlly: 1.5.0 + mlly: 1.6.0 pathe: 1.1.2 ufo: 1.3.2 dev: true @@ -5167,7 +5180,7 @@ packages: h3: 1.10.0 http-shutdown: 1.2.2 jiti: 1.21.0 - mlly: 1.5.0 + mlly: 1.6.0 node-forge: 1.3.1 pathe: 1.1.2 std-env: 3.7.0 @@ -5185,7 +5198,7 @@ packages: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} dependencies: - mlly: 1.5.0 + mlly: 1.6.0 pkg-types: 1.0.3 dev: true @@ -5526,7 +5539,7 @@ packages: fs-extra: 11.2.0 globby: 13.2.2 jiti: 1.21.0 - mlly: 1.5.0 + mlly: 1.6.0 mri: 1.2.0 pathe: 1.1.2 postcss: 8.4.33 @@ -5541,6 +5554,15 @@ packages: pathe: 1.1.2 pkg-types: 1.0.3 ufo: 1.3.2 + dev: true + + /mlly@1.6.0: + resolution: {integrity: sha512-YOvg9hfYQmnaB56Yb+KrJE2u0Yzz5zR+sLejEvF4fzwzV1Al6hkf2vyHTwqCRyv0hCi9rVCqVoXpyYevQIRwLQ==} + dependencies: + acorn: 8.11.3 + pathe: 1.1.2 + pkg-types: 1.0.3 + ufo: 1.3.2 /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} @@ -5648,7 +5670,7 @@ packages: listhen: 1.5.6 magic-string: 0.30.5 mime: 3.0.0 - mlly: 1.5.0 + mlly: 1.6.0 mri: 1.2.0 node-fetch-native: 1.6.1 ofetch: 1.3.3 @@ -5929,7 +5951,7 @@ packages: klona: 2.0.6 knitwork: 1.0.0 magic-string: 0.30.5 - mlly: 1.5.0 + mlly: 1.6.0 nitropack: 2.8.1 nuxi: 3.10.0 nypm: 0.3.4 @@ -6312,7 +6334,7 @@ packages: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 - mlly: 1.5.0 + mlly: 1.6.0 pathe: 1.1.2 /pluralize@8.0.0: @@ -7739,7 +7761,7 @@ packages: jiti: 1.21.0 magic-string: 0.30.5 mkdist: 1.4.0(typescript@5.3.3) - mlly: 1.5.0 + mlly: 1.6.0 pathe: 1.1.2 pkg-types: 1.0.3 pretty-bytes: 6.1.1 @@ -7831,7 +7853,7 @@ packages: fast-glob: 3.3.2 local-pkg: 0.5.0 magic-string: 0.30.5 - mlly: 1.5.0 + mlly: 1.6.0 pathe: 1.1.2 pkg-types: 1.0.3 scule: 1.2.0 @@ -7876,7 +7898,7 @@ packages: fast-glob: 3.3.2 json5: 2.2.3 local-pkg: 0.4.3 - mlly: 1.5.0 + mlly: 1.6.0 pathe: 1.1.2 scule: 1.2.0 unplugin: 1.6.0 diff --git a/src/index.ts b/src/index.ts index e493a9b..fdea68a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ -import { fileURLToPath } from "node:url"; import { relative, resolve } from "node:path"; import { promises as fs } from "node:fs"; +import { fileURLToPath } from "mlly"; import type { Nitro } from "nitropack"; import type { Nuxt } from "nuxt/schema"; import consola from "consola"; @@ -56,13 +56,13 @@ async function nitroModule(nitro: Nitro) { // Make sure runtime is transpiled nitro.options.externals.inline = nitro.options.externals.inline || []; nitro.options.externals.inline.push( - fileURLToPath(new URL("runtime/", import.meta.url)), + fileURLToPath(new URL("runtime/", import.meta.url)) ); // Add plugin to inject bindings to dev server nitro.options.plugins = nitro.options.plugins || []; nitro.options.plugins.push( - fileURLToPath(new URL("runtime/plugin.dev", import.meta.url)), + fileURLToPath(new URL("runtime/plugin.dev", import.meta.url)) ); }