forked from FhenixProtocol/fhenix.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
47 lines (46 loc) · 1.41 KB
/
rollup.config.mjs
File metadata and controls
47 lines (46 loc) · 1.41 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
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import wasm from '@rollup/plugin-wasm';
export default [
// browser-friendly UMD build
{
input: "./lib/esm/index.js",
output: {
banner: "const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {});",
name: 'fhenixjs',
file: 'dist/fhenix.umd.js',
format: 'umd',
sourcemap: true
},
plugins: [
commonjs(), // so Rollup can convert modules to an ES module
wasm({targetEnv: "auto-inline"}),
resolve({
browser: true,
extensions: ['.js', '.ts', '.wasm'],
exportConditions: ["import", "default"],
mainFields: ["module", "main", "browser"],
modulesOnly: false,
preferBuiltins: false,
})
]
},
{
input: "./lib/esm/index.js",
plugins: [
commonjs(), // so Rollup can convert modules to an ES module
wasm({targetEnv: "auto-inline"}),
resolve({
browser: true,
extensions: ['.js', '.ts', '.wasm'],
// exportConditions: ["import", "default"],
// mainFields: ["module", "main"],
modulesOnly: false,
preferBuiltins: false,
})
],
output: [
{ file: 'dist/fhenix.esm.js', format: 'esm', sourcemap: true },
]
}
];