mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
feat: support staticAssetsBase
This commit is contained in:
parent
005421e04d
commit
415db060b0
@ -24,6 +24,13 @@ export interface SLSOptions {
|
|||||||
analyze: boolean
|
analyze: boolean
|
||||||
minify: boolean
|
minify: boolean
|
||||||
rollupConfig?: any
|
rollupConfig?: any
|
||||||
|
fullStatic: boolean,
|
||||||
|
staticAssets: {
|
||||||
|
base: string
|
||||||
|
versionBase: string
|
||||||
|
dir: string
|
||||||
|
version: string
|
||||||
|
}
|
||||||
hooks: { [key: string]: any } // TODO: export from hookable
|
hooks: { [key: string]: any } // TODO: export from hookable
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,6 +41,9 @@ export function getoptions (nuxtOptions: NuxtOptions): SLSOptions {
|
|||||||
rootDir: nuxtOptions.rootDir,
|
rootDir: nuxtOptions.rootDir,
|
||||||
buildDir: nuxtOptions.buildDir,
|
buildDir: nuxtOptions.buildDir,
|
||||||
publicDir: nuxtOptions.generate.dir,
|
publicDir: nuxtOptions.generate.dir,
|
||||||
|
fullStatic: nuxtOptions.target === 'static' && !nuxtOptions._legacyGenerate,
|
||||||
|
// @ts-ignore
|
||||||
|
staticAssets: nuxtOptions.generate.staticAssets,
|
||||||
outName: 'server.js',
|
outName: 'server.js',
|
||||||
templates: [],
|
templates: [],
|
||||||
static: [],
|
static: [],
|
||||||
|
@ -72,7 +72,10 @@ export const getRollupConfig = (config: SLSOptions) => {
|
|||||||
options.plugins.push(replace({
|
options.plugins.push(replace({
|
||||||
values: {
|
values: {
|
||||||
'process.env.NODE_ENV': '"production"',
|
'process.env.NODE_ENV': '"production"',
|
||||||
'typeof window': '"undefined"'
|
'typeof window': '"undefined"',
|
||||||
|
'process.env.NUXT_STATIC_BASE': JSON.stringify(config.staticAssets.base),
|
||||||
|
'process.env.NUXT_STATIC_VERSION': JSON.stringify(config.staticAssets.version),
|
||||||
|
'process.env.NUXT_FULL_STATIC': config.fullStatic
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user