fix: lazy require @vitejs/plugin-vue to respect NODE_ENV

pull/461/head
Evan You 3 years ago
parent 7c530a50ad
commit a051e66f1a

@ -6,7 +6,6 @@ import {
MarkdownCompileResult MarkdownCompileResult
} from './markdownToVue' } from './markdownToVue'
import { DIST_CLIENT_PATH, APP_PATH, SITE_DATA_REQUEST_PATH } from './alias' import { DIST_CLIENT_PATH, APP_PATH, SITE_DATA_REQUEST_PATH } from './alias'
import createVuePlugin from '@vitejs/plugin-vue'
import { slash } from './utils/slash' import { slash } from './utils/slash'
import { OutputAsset, OutputChunk } from 'rollup' import { OutputAsset, OutputChunk } from 'rollup'
@ -55,7 +54,8 @@ export function createVitePressPlugin(
publicDir: string publicDir: string
) => MarkdownCompileResult ) => MarkdownCompileResult
const vuePlugin = createVuePlugin({ // lazy require plugin-vue to respect NODE_ENV in @vue/compiler-x
const vuePlugin = require('@vitejs/plugin-vue')({
include: [/\.vue$/, /\.md$/], include: [/\.vue$/, /\.md$/],
...userVuePluginOptions ...userVuePluginOptions
}) })

Loading…
Cancel
Save