|
|
|
@ -38,10 +38,7 @@ export async function bundle(
|
|
|
|
|
// resolve options to pass to vite
|
|
|
|
|
const { rollupOptions } = options
|
|
|
|
|
|
|
|
|
|
const resolveViteConfig = async (ssr: boolean): Promise<ViteUserConfig> => {
|
|
|
|
|
// use different entry based on ssr or not
|
|
|
|
|
input['app'] = path.resolve(APP_PATH, ssr ? 'ssr.js' : 'index.js')
|
|
|
|
|
return {
|
|
|
|
|
const resolveViteConfig = async (ssr: boolean): Promise<ViteUserConfig> => ({
|
|
|
|
|
root: config.srcDir,
|
|
|
|
|
base: config.site.base,
|
|
|
|
|
logLevel: 'warn',
|
|
|
|
@ -62,7 +59,11 @@ export async function bundle(
|
|
|
|
|
cssCodeSplit: false,
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
...rollupOptions,
|
|
|
|
|
input,
|
|
|
|
|
input: {
|
|
|
|
|
...input,
|
|
|
|
|
// use different entry based on ssr or not
|
|
|
|
|
app: path.resolve(APP_PATH, ssr ? 'ssr.js' : 'index.js')
|
|
|
|
|
},
|
|
|
|
|
// important so that each page chunk and the index export things for each
|
|
|
|
|
// other
|
|
|
|
|
preserveEntrySignatures: 'allow-extension',
|
|
|
|
@ -100,8 +101,7 @@ export async function bundle(
|
|
|
|
|
// minify with esbuild in MPA mode (for CSS)
|
|
|
|
|
minify: ssr ? (config.mpa ? 'esbuild' : false) : !process.env.DEBUG
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let clientResult: RollupOutput
|
|
|
|
|
let serverResult: RollupOutput
|
|
|
|
|