-
Notifications
You must be signed in to change notification settings - Fork 6
/
rollup.config.mjs
59 lines (57 loc) · 1.34 KB
/
rollup.config.mjs
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 { defineExternal, definePlugins } from '@gera2ld/plaid-rollup';
import { defineConfig } from 'rollup';
import solidPkg from 'solid-js/package.json' with { type: 'json' };
import pkg from './package.json' with { type: 'json' };
const external = defineExternal(Object.keys(pkg.dependencies));
const bundleOptions = {
extend: true,
esModule: false,
};
const outputOptions = {
indent: false,
banner: `/*! ${pkg.name}@${pkg.version} | ${pkg.license} License */`,
};
const replaceValues = {
'process.env.VERSION': pkg.version,
};
export default defineConfig([
{
input: 'src/index.ts',
plugins: definePlugins({
replaceValues,
}),
external,
output: {
format: 'esm',
file: `dist/index.mjs`,
...outputOptions,
},
},
{
input: 'src/index.ts',
plugins: definePlugins({
replaceValues,
}),
output: {
format: 'iife',
file: `dist/index.js`,
name: 'VM',
...outputOptions,
...bundleOptions,
},
},
{
input: 'src/solid.ts',
plugins: definePlugins({
replaceValues,
}),
output: {
format: 'iife',
file: `dist/solid.js`,
name: 'VM.solid',
...outputOptions,
...bundleOptions,
banner: `/*! ${pkg.name}@${pkg.version}/solid-js solid-js@${solidPkg.version} | ${solidPkg.license} License */`,
},
},
]);