mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
feat: support staticAssetsBase
This commit is contained in:
parent
005421e04d
commit
415db060b0
@ -24,6 +24,13 @@ export interface SLSOptions {
|
||||
analyze: boolean
|
||||
minify: boolean
|
||||
rollupConfig?: any
|
||||
fullStatic: boolean,
|
||||
staticAssets: {
|
||||
base: string
|
||||
versionBase: string
|
||||
dir: string
|
||||
version: string
|
||||
}
|
||||
hooks: { [key: string]: any } // TODO: export from hookable
|
||||
}
|
||||
|
||||
@ -34,6 +41,9 @@ export function getoptions (nuxtOptions: NuxtOptions): SLSOptions {
|
||||
rootDir: nuxtOptions.rootDir,
|
||||
buildDir: nuxtOptions.buildDir,
|
||||
publicDir: nuxtOptions.generate.dir,
|
||||
fullStatic: nuxtOptions.target === 'static' && !nuxtOptions._legacyGenerate,
|
||||
// @ts-ignore
|
||||
staticAssets: nuxtOptions.generate.staticAssets,
|
||||
outName: 'server.js',
|
||||
templates: [],
|
||||
static: [],
|
||||
|
@ -72,7 +72,10 @@ export const getRollupConfig = (config: SLSOptions) => {
|
||||
options.plugins.push(replace({
|
||||
values: {
|
||||
'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