-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.config.ts
59 lines (56 loc) · 1.08 KB
/
build.config.ts
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
import { defineBuildConfig } from "unbuild"
import pack from "./package.json"
const banner = `/*!
* Quran Meta library ${pack.version}
*
* Released under the MIT license
*/
`
export default defineBuildConfig({
declaration: true,
rollup: {
emitCJS: true,
output: {
banner: banner
}
},
entries: [
"./src/index",
{
builder: "mkdist",
input: "./src/",
outDir: "./lib_es",
format: "esm"
},
{
input: "src/",
outDir: "lib_cjs/",
format: "cjs",
ext: "cjs",
declaration: false
}
],
hooks: {
"rollup:options": (ctx, option) => {
option.output?.push(
{
entryFileNames: "quran-meta.js",
name: "quranMeta",
dir: "dist",
format: "umd",
banner: banner,
sourcemap: true
},
{
entryFileNames: "quran-meta.min.js",
name: "quranMeta",
inlineDynamicImports: true,
dir: "dist",
format: "umd",
banner: banner,
compact: true
}
)
}
}
})