generated from trashhalo/obsidian-rust-plugin
-
Notifications
You must be signed in to change notification settings - Fork 10
/
rollup.config.js
33 lines (32 loc) · 891 Bytes
/
rollup.config.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
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { base64 } from 'rollup-plugin-base64';
import typescript from '@rollup/plugin-typescript';
import webWorkerLoader from 'rollup-plugin-web-worker-loader';
import replace from '@rollup/plugin-replace';
export default {
input: 'src/main.ts',
output: {
//file: 'main.js',
dir: '.',
sourcemap: 'inline',
format: 'cjs',
exports: 'default',
},
external: ['obsidian', 'React', 'ReactDOM', 'path', 'fs'],
plugins: [
replace({
delimiters: ['', ''],
}),
nodeResolve({ browser: true }),
commonjs({ ignore: ['original-fs'] }),
base64({ include: "**/*.wasm" }),
typescript(),
webWorkerLoader({
targetPlatform: 'browser',
extensions: ['.ts'],
preserveSource: true,
sourcemap: true,
}),
]
};