1 Star 0 Fork 585

云天网络/layui-vue

forked from Layui Vue/layui-vue 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
import path from 'path'
import { defineConfig } from 'vite'
import babel from '@rollup/plugin-babel'
import { name } from './package.json'
import plugins from './docs/src/plugin/common-plugins'
const camelize = (name: string) =>
name.replace(/(^|-)(\w)/g, (a, b, c) => c.toUpperCase())
export default defineConfig({
root: path.resolve(__dirname, 'docs'),
resolve: {
alias: {
'/@src': path.resolve(__dirname, 'src'),
},
},
build: {
target: 'es2015',
outDir: path.resolve(__dirname, 'lib'),
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: camelize(name),
},
rollupOptions: {
output: {
exports: 'named',
globals: (id: string) => {
const name = id.replace(/^@/, '').split('/')[0]
return camelize(name)
},
assetFileNames: 'layui.css',
},
plugins: [
babel({
exclude: 'node_modules/**',
extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue'],
presets: ['@babel/preset-env', '@babel/preset-typescript'],
}),
],
external: ['vue', 'vue-router'],
},
},
plugins,
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ytnet/layui-vue.git
git@gitee.com:ytnet/layui-vue.git
ytnet
layui-vue
layui-vue
master

搜索帮助