1 Star 5 Fork 3

iocui/vue2-vite-ts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vite.config.ts 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* ==============================================================
* 配置项 build/plugins/server 已分离到 config/bootstrap 中独立管理
* --------------------------------------------------------------
* 其他配置项都可以在这里添加,详情参考 https://vitejs.dev/config/
* ==============================================================
*/
import configBootstrap from './config/bootstrap';
import { defineConfig } from 'vite';
import { resolve } from 'path';
export default defineConfig(async config =>
configBootstrap(
config,
{
envPrefix: 'VITE_',
resolve: {
alias: [
{ find: '@/', replacement: `${resolve(__dirname, 'src')}/` },
{ find: '~/', replacement: `${resolve(__dirname, 'src')}/` },
{ find: '~@/', replacement: `${resolve(__dirname, 'config/modules')}/` },
//===============================================================
// 只需运行时 => new Vue({render (h) {return h('div', 'Hello')}})
// 需要编译器 => new Vue({template: '<div>Hello</div>'})
// --------------------------------------------------------------
// 注:仅为了支持 vue2 组件编译 template 字符模板, 不需编译器可注释掉
//--------------------------------------------------------------
// 较小,需在 .env.production 中配置 NODE_ENV 参数
//---------------------------------------------------------------
{ find: 'vue', replacement: 'vue/dist/vue.common.js' }
//---------------------------------------------------------------
// 文件较大,不需在 .env.production 中配置 NODE_ENV 参数
//---------------------------------------------------------------
// { find: 'vue', replacement: 'vue/dist/vue.esm.js' }
//===============================================================
]
},
css: {
preprocessorOptions: {
scss: { charset: false }
}
}
},
__dirname
)
);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/iocui/vue2-vite-ts.git
git@gitee.com:iocui/vue2-vite-ts.git
iocui
vue2-vite-ts
vue2-vite-ts
master

搜索帮助