-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
61 lines (55 loc) · 1.2 KB
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* 扩展配置
*/
import json from '@rollup/plugin-json';
console.log('vite.config');
import path from 'path';
// 是否为生产环境
// const isProduction = process.env.NODE_ENV === 'production';
// 路径
const resolve = (dir) => {
let _path = path.join(__dirname, dir);
console.log('vite', _path);
return _path;
};
module.exports = {
// devServer: {
// port: 8080,
// },
// root: 'packages',
// outDir: 'ui',
// output: {
// format: 'esm',
// file: './dist/bundle.js',
// },
// input: 'packages/index.js',
// external: ['vue'],
// output: {
// format: 'esm',
// file: 'dist/bundle.js',
// },
alias: {
'@': resolve('src'),
// 带完整组件编译执行
vue: 'vue/dist/vue.esm-bundler.js',
//qvui: resolve('packages'),
},
plugins: [
// // resolve({
// // extensions: ['.vue', '.js', '.css'],
// // }),
// // vue({
// // template: {
// // isProduction: true,
// // },
// // }),
// // postcss({
// // extract: 'bundle.css',
// // }),
//json读取
json(),
// copy({
// targets: [{ src: 'src/assets/*', dest: 'dist/assets' }],
// }),
],
};