This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { defineConfig } from 'vite' | ||
// import { SearchPlugin } from 'vitepress-plugin-search' | ||
// import Segment from 'segment' // 中文分词器 | ||
// // import flexSearchIndexOptions from 'flexsearch' | ||
// // 创建实例 | ||
// const segment = new Segment() | ||
// // 使用默认的识别模块及字典,载入字典文件需要1秒,仅初始化时执行一次即可 | ||
// segment.useDefault() | ||
// // 开始分词 | ||
// // console.log(segment.doSegment('这是一个基于Node.js的中文分词模块。')); | ||
|
||
// const options = { | ||
// // ...flexSearchIndexOptions, | ||
// // 采用分词器优化, | ||
// encode: function (str) { | ||
// return segment.doSegment(str, { simple: true }) | ||
// }, | ||
// tokenize: 'forward', // 解决汉字搜索问题。来源:https://github.com/emersonbottero/vitepress-plugin-search/issues/11 | ||
|
||
// // 以下代码返回完美的结果,但内存与空间消耗巨大,索引文件达到80M+ | ||
// // encode: false, | ||
// // tokenize: "full", | ||
// } | ||
|
||
export default defineConfig({ | ||
// plugins: [ | ||
// // SearchPlugin({ | ||
// // tokenize: 'full', | ||
// // }), | ||
// SearchPlugin(options), | ||
// ], | ||
}) |