-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.mts
More file actions
26 lines (25 loc) · 819 Bytes
/
Copy pathvite.config.mts
File metadata and controls
26 lines (25 loc) · 819 Bytes
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
/* eslint-disable import/no-extraneous-dependencies */
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import { createBlockletPlugin } from 'vite-plugin-blocklet';
import svgr from 'vite-plugin-svgr';
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
plugins: [react(), createBlockletPlugin(), svgr()],
resolve: {
alias: {
// Some dependencies (e.g. mime-types) rely on `path.extname` which is Node-only.
// In browser builds, map `path` to a browser-compatible implementation.
path: 'path-browserify',
},
},
build: {
// 禁止 preload 可以解决 js 的请求没有 referer 的问题
cssCodeSplit: false,
commonjsOptions: {
transformMixedEsModules: true,
},
},
};
});