-
Notifications
You must be signed in to change notification settings - Fork 383
Expand file tree
/
Copy pathvite.lib-config.js
More file actions
48 lines (39 loc) · 1012 Bytes
/
vite.lib-config.js
File metadata and controls
48 lines (39 loc) · 1012 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import { packageAliases } from './vite.config.js';
export default ( { mode } ) => {
process.env = { ...process.env, ...loadEnv( mode, process.cwd() ) };
const entry = {
'index': './src/index.js',
'index.plugins': './src/plugins.js',
'index.core': './src/core/renderer/index.js',
'index.three': './src/three/renderer/index.js',
'index.babylonjs': './src/babylonjs/renderer/index.js',
'index.r3f': './src/r3f/index.jsx',
'index.core-plugins': './src/core/plugins/index.js',
'index.three-plugins': './src/three/plugins/index.js'
};
return {
root: './',
envDir: '.',
base: '',
resolve: {
alias: packageAliases,
},
build: {
sourcemap: true,
outDir: './build/',
minify: true,
rollupOptions: {
external: ( p ) => {
return ! /^[./\\]/.test( p ) && ! /^3d-tiles-renderer/.test( p );
},
},
lib: {
entry,
formats: [ 'es' ],
},
},
plugins: [ react() ],
};
};