explicitly set outName in targets to avoid regression

This commit is contained in:
Pooya Parsa 2020-11-11 15:27:08 +01:00
parent 35720380c2
commit b258c2af2c
5 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@ if ('serviceWorker' in navigator) {
return {
entry: '{{ runtimeDir }}/targets/service-worker',
targetDir: '{{ publicDir }}',
outName: '_nuxt.js',
nuxtHooks: {
'vue-renderer:ssr:templateParams' (params) {
params.APP += script

View File

@ -6,6 +6,7 @@ import { worker } from './worker'
export const cloudflare: SLSTarget = extendTarget(worker, {
entry: '{{ runtimeDir }}/targets/cloudflare',
outName: '_nuxt.js',
generateIgnore: [
'wrangler.toml'
],

View File

@ -5,6 +5,7 @@ import { SLSTarget } from '../config'
export const lambda: SLSTarget = {
entry: '{{ runtimeDir }}/targets/lambda',
outName: '_nuxt.js',
hooks: {
'done' ({ rollupConfig }) {
const entry = relative(process.cwd(), rollupConfig.output.file).replace(/\.js$/, '')

View File

@ -3,6 +3,7 @@ import { SLSTarget } from '../config'
import { lambda } from './lambda'
export const netlify: SLSTarget = extendTarget(lambda, {
outName: '_nuxt.js',
generateIgnore: [
'netlify.toml',
'_redirects'

View File

@ -4,9 +4,12 @@ import { SLSTarget } from '../config'
export const node: SLSTarget = {
entry: '{{ runtimeDir }}/targets/node',
outName: 'index.js',
hooks: {
'done' ({ rollupConfig }) {
const entry = relative(process.cwd(), rollupConfig.output.file).replace(/\.js$/, '')
const entry = relative(process.cwd(), rollupConfig.output.file)
.replace(/\.js$/, '')
.replace(/\/index$/, '')
consola.info(`Ready to deploy node entrypoint: \`${entry}\``)
consola.info(`You can try using \`node ${entry} [path]\``)
}