diff --git a/packages/nitro/src/rollup/config.ts b/packages/nitro/src/rollup/config.ts index e3309e35c4..eadcfe8f85 100644 --- a/packages/nitro/src/rollup/config.ts +++ b/packages/nitro/src/rollup/config.ts @@ -102,9 +102,9 @@ export const getRollupConfig = (config: SLSOptions) => { options.plugins.push(alias({ entries: { '~runtime': config.runtimeDir, - '~renderer': require.resolve(resolve(config.runtimeDir, renderer)), + '~renderer': require.resolve(resolve(config.runtimeDir, 'ssr', renderer)), '~build': config.buildDir, - '~mock': require.resolve(resolve(config.runtimeDir, 'mock')), + '~mock': require.resolve(resolve(config.runtimeDir, 'utils/mock')), ...mocks.reduce((p, c) => ({ ...p, [c]: '~mock' }), {}), ...providedDeps.reduce((p, c) => ({ ...p, [c]: require.resolve(c) }), {}) } diff --git a/packages/nitro/src/targets/browser.ts b/packages/nitro/src/targets/browser.ts index 46471fed0d..33e45dfdda 100644 --- a/packages/nitro/src/targets/browser.ts +++ b/packages/nitro/src/targets/browser.ts @@ -15,6 +15,7 @@ if ('serviceWorker' in navigator) { `.replace(/\n| +/g, '') return { + entry: '{{ runtimeDir }}/targets/service-worker', targetDir: '{{ publicDir }}', nuxtHooks: { 'vue-renderer:ssr:templateParams' (params) { diff --git a/packages/nitro/src/targets/cloudflare.ts b/packages/nitro/src/targets/cloudflare.ts index e47522a0c5..76fbddff3d 100644 --- a/packages/nitro/src/targets/cloudflare.ts +++ b/packages/nitro/src/targets/cloudflare.ts @@ -5,7 +5,7 @@ import { SLSOptions, SLSTarget } from '../config' import { worker } from './worker' export const cloudflare: SLSTarget = extendTarget(worker, { - entry: '{{ runtimeDir }}/cloudflare', + entry: '{{ runtimeDir }}/targets/cloudflare', generateIgnore: [ 'wrangler.toml' ], diff --git a/packages/nitro/src/targets/lambda.ts b/packages/nitro/src/targets/lambda.ts index 6603c97c1f..a309641f8e 100644 --- a/packages/nitro/src/targets/lambda.ts +++ b/packages/nitro/src/targets/lambda.ts @@ -4,7 +4,7 @@ import consola from 'consola' import { SLSTarget } from '../config' export const lambda: SLSTarget = { - entry: '{{ runtimeDir }}/lambda', + entry: '{{ runtimeDir }}/targets/lambda', hooks: { 'done' ({ rollupConfig }) { const entry = relative(process.cwd(), rollupConfig.output.file).replace(/\.js$/, '') diff --git a/packages/nitro/src/targets/node.ts b/packages/nitro/src/targets/node.ts index 5c5a4a7a2b..b687c0761d 100644 --- a/packages/nitro/src/targets/node.ts +++ b/packages/nitro/src/targets/node.ts @@ -3,7 +3,7 @@ import consola from 'consola' import { SLSTarget } from '../config' export const node: SLSTarget = { - entry: '{{ runtimeDir }}/node', + entry: '{{ runtimeDir }}/targets/node', hooks: { 'done' ({ rollupConfig }) { const entry = relative(process.cwd(), rollupConfig.output.file).replace(/\.js$/, '') diff --git a/packages/nitro/src/targets/worker.ts b/packages/nitro/src/targets/worker.ts index 2b392f3a30..76806a186e 100644 --- a/packages/nitro/src/targets/worker.ts +++ b/packages/nitro/src/targets/worker.ts @@ -12,7 +12,7 @@ const o=Date.now(),t=()=>Date.now()-o;process.hrtime=o=>{const e=Math.floor(.001 ` export const worker: SLSTarget = { - entry: '{{ runtimeDir }}/worker', + entry: null, // Abstract node: false, hooks: { 'rollup:before' ({ rollupConfig }) {