能同时开启ssr和ssg吗 #6380
Unanswered
hubcodemke
asked this question in
Q&A
能同时开启ssr和ssg吗
#6380
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
比如一个入口内,我用约定式路由,然后新闻页和新闻详情页走ssr,其他全部ssg,该如何配置
import { appTools } from '@modern-js/app-tools';
import { defineConfig } from '@modern-js/app-tools';
import { ssgPlugin } from '@modern-js/plugin-ssg';
// https://modernjs.dev/en/configure/app/usage
export default defineConfig({
runtime: {
router: true,
},
server: {
// ssr: true,
},
output: {
ssg: {
preventDefault: ['/news'],
},
},
html: {
disableHtmlFolder: true,
},
plugins: [
appTools({
bundler: 'rspack', // Set to 'webpack' to enable webpack
}),
ssgPlugin(),
],
});
Beta Was this translation helpful? Give feedback.
All reactions