mirror of
https://github.com/andatoshiki/toshiki-notebook.git
synced 2026-06-06 09:16:45 +00:00
chore: update vite webpack config with new plugin and page behavior parameters implemented
This commit is contained in:
parent
db49332444
commit
9fcde5bd02
@ -4,9 +4,27 @@ import UnoCSS from 'unocss/vite'
|
|||||||
import { MarkdownTransform } from './.vitepress/plugins/markdownTransform'
|
import { MarkdownTransform } from './.vitepress/plugins/markdownTransform'
|
||||||
import Icons from 'unplugin-icons/vite'
|
import Icons from 'unplugin-icons/vite'
|
||||||
import IconsResolver from 'unplugin-icons/resolver'
|
import IconsResolver from 'unplugin-icons/resolver'
|
||||||
|
import { ArcoResolver } from 'unplugin-vue-components/resolvers'
|
||||||
|
import { resolve } from 'node:path'
|
||||||
|
import { createRequire } from 'node:module'
|
||||||
|
import type { UserConfig } from 'vite'
|
||||||
|
|
||||||
export default defineConfig({
|
const require = createRequire(import.meta.url)
|
||||||
|
|
||||||
|
export default defineConfig(async () => {
|
||||||
|
return <UserConfig>{
|
||||||
|
server: {
|
||||||
|
hmr: {
|
||||||
|
overlay: false,
|
||||||
|
},
|
||||||
|
fs: {
|
||||||
|
allow: [resolve(__dirname, '..')],
|
||||||
|
},
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
// custom markdown transformation plugin with regex
|
||||||
|
MarkdownTransform(),
|
||||||
|
// custom components including plugins
|
||||||
Components({
|
Components({
|
||||||
dirs: ['.vitepress/theme/components'],
|
dirs: ['.vitepress/theme/components'],
|
||||||
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
||||||
@ -14,6 +32,7 @@ export default defineConfig({
|
|||||||
IconsResolver({
|
IconsResolver({
|
||||||
componentPrefix: '',
|
componentPrefix: '',
|
||||||
}),
|
}),
|
||||||
|
ArcoResolver({ sideEffect: true, resolveIcons: true }),
|
||||||
],
|
],
|
||||||
dts: './.vitepress/components.d.ts',
|
dts: './.vitepress/components.d.ts',
|
||||||
transformer: 'vue3',
|
transformer: 'vue3',
|
||||||
@ -24,7 +43,6 @@ export default defineConfig({
|
|||||||
defaultStyle: 'display: inline-block',
|
defaultStyle: 'display: inline-block',
|
||||||
}),
|
}),
|
||||||
UnoCSS(),
|
UnoCSS(),
|
||||||
MarkdownTransform(),
|
|
||||||
],
|
],
|
||||||
css: {
|
css: {
|
||||||
postcss: {
|
postcss: {
|
||||||
@ -36,5 +54,13 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
chunkSizeWarningLimit: 1600,
|
chunkSizeWarningLimit: 1600,
|
||||||
|
// rollup build options
|
||||||
|
rollupOptions: {
|
||||||
|
external: [
|
||||||
|
'node:*',
|
||||||
|
'./assets/*',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user