forked from Quorafind/Obsidian-Thino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
35 lines (33 loc) · 870 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
34
35
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import less from '@rollup/plugin-less';
const isProd = process.env.BUILD === 'production';
export default {
input: 'src/index.ts',
output: {
format: 'cjs',
file: 'main.js',
exports: 'default',
sourcemap: 'inline',
sourcemapExcludeSources: isProd,
},
external: ['obsidian', 'fs', 'os', 'path'],
sourceMap: true,
plugins: [
less(),
typescript(),
resolve({
browser: true,
}),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
babel({
presets: ['@babel/preset-react', '@babel/preset-typescript'],
}),
commonjs(),
],
};