1 Star 0 Fork 0

dylan66ty/vite-vue2-tpl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.js 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
dylan66ty 提交于 2021-09-04 23:39 . init
const PACKAGE_ROOT = __dirname;
import { defineConfig } from "vite";
// import vue from '@vitejs/plugin-vue'; // vue3
import { createVuePlugin } from 'vite-plugin-vue2' // vue2
import path from 'path'
export default ({ command, mode }) => {
//console.log(command) // serve
//console.log(mode) // development
return {
plugins: [createVuePlugin({
jsx: true
})],
mode: process.env.MODE,
root: PACKAGE_ROOT,
resolve: {
alias: {
'@': path.join(PACKAGE_ROOT, 'src'),
'@components': path.join(PACKAGE_ROOT, 'src/components'),
'@utils': path.join(PACKAGE_ROOT, 'src/utils'),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json']
},
base: './',
server: {
fs: {
strict: true,
},
},
build: {
sourcemap: true,
target: `es2015`,
outDir: 'dist',
assetsDir: './',
terserOptions: {
ecma: 2020,
compress: {
passes: 2,
},
safari10: false,
},
rollupOptions: {
},
emptyOutDir: true,
brotliSize: false,
},
assetsInlineLimit: 2000
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dylan66ty/vite-vue2-tpl.git
git@gitee.com:dylan66ty/vite-vue2-tpl.git
dylan66ty
vite-vue2-tpl
vite-vue2-tpl
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385