niucloud/uni-app/scripts/windi-vite-options.cjs
wangchen14709853322 5ed9a0ba81 v2.0-beta-20260626
v2框架公测版测试流程请看v2.0-beta.md
2026-07-01 12:25:30 +08:00

32 lines
811 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Windi 扫描范围:仅 src并排除 .build/dist避免 Windows 上残留备份目录 EPERM
*/
const SCAN_EXCLUDE = [
'node_modules',
'.git',
'dist',
'.build',
'.build/**',
'**/.build/**',
'**/addon-pages-backup/**'
]
/** Core 分构建:插件 DIY 组件运行时加载,不参与 Windi / 编译扫描 */
const CORE_SCAN_EXCLUDE = [
...SCAN_EXCLUDE,
'src/addon/*/components/**',
'**/src/addon/*/components/**'
]
function createWindiPluginOptions(dirs = ['src'], { coreBuild = false } = {}) {
return {
scan: {
dirs,
fileExtensions: ['vue', 'js', 'ts'],
exclude: coreBuild ? CORE_SCAN_EXCLUDE : SCAN_EXCLUDE
}
}
}
module.exports = { createWindiPluginOptions, SCAN_EXCLUDE, CORE_SCAN_EXCLUDE }