forked from SSShooter/mind-elixir-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.js
35 lines (34 loc) · 751 Bytes
/
build.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
import { fileURLToPath } from 'url'
import { build } from 'vite'
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const buildList = [
{
name: 'MindElixir',
enrty: __dirname + './src/index.ts',
},
{
name: 'MindElixirLite',
enrty: __dirname + './src/index.ts',
mode: 'lite',
},
{
name: 'example',
enrty: __dirname + './src/exampleData/1.ts',
},
]
for (let i = 0; i < buildList.length; i++) {
const info = buildList[i]
console.log(`\n\nBuilding ${info.name}...\n\n`)
await build({
build: {
emptyOutDir: i === 0,
lib: {
entry: info.enrty,
fileName: info.name,
name: info.name,
formats: ['iife', 'es'],
},
},
mode: info.mode,
})
}