fix: configurable publicPath (closes #21)

This commit is contained in:
Pooya Parsa 2020-11-11 14:42:10 +01:00
parent 2e329d0403
commit aff2372650
2 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@ export interface SLSOptions {
buildDir: string buildDir: string
publicDir: string publicDir: string
routerBase: string routerBase: string
publicPath: string
fullStatic: boolean fullStatic: boolean
staticAssets: any staticAssets: any
@ -63,6 +64,7 @@ export function getoptions (nuxt: SLSNuxt): SLSOptions {
buildDir: nuxt.options.buildDir, buildDir: nuxt.options.buildDir,
publicDir: nuxt.options.generate.dir, publicDir: nuxt.options.generate.dir,
routerBase: nuxt.options.router.base, routerBase: nuxt.options.router.base,
publicPath: nuxt.options.build.publicPath,
fullStatic: nuxt.options.target === 'static' && !nuxt.options._legacyGenerate, fullStatic: nuxt.options.target === 'static' && !nuxt.options._legacyGenerate,
staticAssets: nuxt.options.generate.staticAssets, staticAssets: nuxt.options.generate.staticAssets,

View File

@ -77,6 +77,7 @@ export const getRollupConfig = (config: SLSOptions) => {
'process.env.NODE_ENV': '"production"', 'process.env.NODE_ENV': '"production"',
'typeof window': '"undefined"', 'typeof window': '"undefined"',
'process.env.ROUTER_BASE': JSON.stringify(config.routerBase), 'process.env.ROUTER_BASE': JSON.stringify(config.routerBase),
'process.env.PUBLIC_PATH': JSON.stringify(config.publicPath),
'process.env.NUXT_STATIC_BASE': JSON.stringify(config.staticAssets.base), 'process.env.NUXT_STATIC_BASE': JSON.stringify(config.staticAssets.base),
'process.env.NUXT_STATIC_VERSION': JSON.stringify(config.staticAssets.version), 'process.env.NUXT_STATIC_VERSION': JSON.stringify(config.staticAssets.version),
// @ts-ignore // @ts-ignore