This repository was archived by the owner on Feb 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
83 lines (79 loc) · 1.72 KB
/
rollup.config.mjs
File metadata and controls
83 lines (79 loc) · 1.72 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// import commonjs from '@rollup/plugin-commonjs'
import copy from 'rollup-plugin-copy'
import typescript from '@rollup/plugin-typescript'
import terser from '@rollup/plugin-terser'
import pkg from './package.json' with { type: 'json' }
import { createRequire } from 'node:module'
const CAPTCHA_PATH = 'src/captcha.ts'
const CAPTCHA_LOADER_PATH = 'src/captcha-loader.ts'
const POW_WORKER_PATH = 'src/pow-worker.ts'
const require = createRequire(import.meta.url)
export default [
{
input: CAPTCHA_PATH,
output: [
{
file: pkg.captcha,
format: 'umd',
name: 'captcha',
sourcemap: true,
},
],
plugins: [
typescript({
outDir: './dist',
sourceMap: true,
tslib: require.resolve('tslib'),
}),
// copying assets
copy({
targets: [
{ src: 'src/assets/*', dest: 'dist/assets' },
{ src: 'src/pages/*', dest: 'dist/pages' },
],
}),
terser(),
// commonjs(),
],
},
{
input: CAPTCHA_LOADER_PATH,
output: [
{
file: pkg.captchaloader,
format: 'umd',
name: 'captcha-loader',
sourcemap: true,
},
],
plugins: [
typescript({
outDir: './dist',
sourceMap: true,
tslib: require.resolve('tslib'),
}),
terser(),
// commonjs(),
],
},
{
input: POW_WORKER_PATH,
output: [
{
file: 'dist/pow-worker.js',
format: 'iife',
name: 'powWorker',
sourcemap: true,
},
],
plugins: [
typescript({
outDir: './dist',
sourceMap: true,
tslib: require.resolve('tslib'),
}),
terser(),
// commonjs(),
],
},
]