代码拉取完成,页面将自动刷新
import { readdirSync, accessSync } from 'fs'
import { DepOptimizationOptions } from 'vite'
export function optimizeDepsIncludes(
mode: string
): DepOptimizationOptions | undefined {
if (mode === 'development') {
const optimizeDepsIncludes = ['element-plus/es']
readdirSync('node_modules/element-plus/es/components').map(dirname => {
try {
accessSync(
`node_modules/element-plus/es/components/${dirname}/style/css.mjs`
)
optimizeDepsIncludes.push(
`element-plus/es/components/${dirname}/style/css`
)
} catch (error) {
// console.log(error)
}
})
readdirSync('node_modules/tinymce/plugins').map(dirname => {
try {
accessSync(`node_modules/tinymce/plugins/${dirname}/index.js`)
optimizeDepsIncludes.push(`tinymce/plugins/${dirname}`)
} catch (error) {
// console.log(error)
}
})
optimizeDepsIncludes.push(`core-js/actual/promise`)
optimizeDepsIncludes.push(`tinymce/tinymce`)
optimizeDepsIncludes.push(`@tinymce/tinymce-vue`)
optimizeDepsIncludes.push(`tinymce/themes/silver`)
optimizeDepsIncludes.push(`tinymce/icons/default`)
console.log(
`预构建数量[${optimizeDepsIncludes.length}], 内容: \n${optimizeDepsIncludes}`
)
return { include: optimizeDepsIncludes }
}
return undefined
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。