mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
tweak target defaults to disable minify and inlining for non workers
This commit is contained in:
parent
a5e70eb4b0
commit
3d2c019a6a
@ -71,6 +71,7 @@ export function getoptions (nuxtOptions: Nuxt['options'], serverless: SLSConfig)
|
||||
outName: '_nuxt.js',
|
||||
logStartup: true,
|
||||
inlineChunks: true,
|
||||
minify: false,
|
||||
|
||||
runtimeDir: resolve(__dirname, '../runtime'),
|
||||
slsDir: '{{ rootDir }}/.nuxt/serverless',
|
||||
|
@ -74,10 +74,7 @@ export default <Module> function slsModule () {
|
||||
nuxt.hook('generate:before', async () => {
|
||||
const { entry } = await build(getoptions(nuxt.options, {
|
||||
target: 'node',
|
||||
serverMiddleware: options.serverMiddleware,
|
||||
node: true,
|
||||
minify: false,
|
||||
analyze: false
|
||||
serverMiddleware: options.serverMiddleware
|
||||
}))
|
||||
require(entry)
|
||||
})
|
||||
|
@ -6,6 +6,7 @@ import { SLSTarget } from '../config'
|
||||
export const lambda: SLSTarget = {
|
||||
entry: '{{ runtimeDir }}/targets/lambda',
|
||||
outName: '_nuxt.js',
|
||||
inlineChunks: false,
|
||||
hooks: {
|
||||
'done' ({ rollupConfig }) {
|
||||
const entry = relative(process.cwd(), rollupConfig.output.file).replace(/\.js$/, '')
|
||||
|
@ -5,6 +5,7 @@ import { SLSTarget } from '../config'
|
||||
export const node: SLSTarget = {
|
||||
entry: '{{ runtimeDir }}/targets/node',
|
||||
outName: 'index.js',
|
||||
inlineChunks: false,
|
||||
hooks: {
|
||||
'done' ({ rollupConfig }) {
|
||||
const entry = relative(process.cwd(), rollupConfig.output.file)
|
||||
|
@ -7,7 +7,6 @@ export const vercel: SLSTarget = extendTarget(node, {
|
||||
targetDir: '{{ rootDir }}/.vercel_build_output',
|
||||
outName: 'functions/node/_nuxt/index.js',
|
||||
publicDir: '{{ targetDir }}/static',
|
||||
inlineChunks: false,
|
||||
generateIgnore: [
|
||||
'vercel.json'
|
||||
],
|
||||
|
@ -13,6 +13,7 @@ global.process = global.process || {};
|
||||
export const worker: SLSTarget = {
|
||||
entry: null, // Abstract
|
||||
node: false,
|
||||
minify: true,
|
||||
hooks: {
|
||||
'rollup:before' ({ rollupConfig }) {
|
||||
rollupConfig.output.intro = polyfill + rollupConfig.output.intro
|
||||
|
Loading…
Reference in New Issue
Block a user