1 Star 0 Fork 562

站望看/Vue3低代码可视化表单

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
vite-lib-render.config.js 1.97 KB
Copy Edit Raw Blame History
tekintian authored 2022-07-17 10:55 . Update vite-lib-render.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import viteSvgIcons from 'vite-plugin-svg-icons'
import { resolve } from 'path'
import commonjs from '@rollup/plugin-commonjs'
import visualizer from 'rollup-plugin-visualizer'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
//添加jsx/tsx支持
vueJsx({}),
//解决引入commonjs模块后打包出现的{'default' is not exported by XXX}错误!!
commonjs({requireReturnsDefault: true}), /* 配置requireReturnsDefault属性,
解决打包后引入VForm出现的"Axios is not a constructor"错!! */
//可视化Bundle
visualizer(),
viteSvgIcons({
// Specify the icon folder to be cached
iconDirs: [resolve(process.cwd(), 'src/icons/svg')],
// Specify symbolId format
symbolId: 'icon-[dir]-[name]',
}),
],
resolve: {
alias: {
"@": resolve(__dirname, 'src'), // 路径别名
},
extensions: ['.js', '.vue', '.json', '.ts'] // 使用路径别名时想要省略的后缀名,可以自己 增减
},
optimizeDeps: {
include: ['@/../lib/vuedraggable/dist/vuedraggable.umd.js', 'quill']
//include: ['quill']
},
css: {
preprocessorOptions: {
scss: {
/* 自动引入全局scss文件 */
additionalData: '@import "./src/styles/global.scss";'
}
}
},
build: {
//minify: false, //
lib: {
entry: resolve(__dirname, 'install-render.js'),
name: 'VFormRender',
fileName: (format) => `render.${format}.js`
},
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external: ['vue', 'element-plus'],
output: {
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
globals: {
vue: 'Vue',
'element-plus': 'ElementPlus',
},
assetFileNames: `render.style.css`
}
}
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/pbove/variant-form3-vite.git
git@gitee.com:pbove/variant-form3-vite.git
pbove
variant-form3-vite
Vue3低代码可视化表单
master

Search