-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
rollup.config.js
35 lines (33 loc) · 868 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 { env } from "process";
const isProd = env.BUILD === 'production';
export default {
input: 'src/main.ts',
output: {
dir: '.',
sourcemap: 'inline',
sourcemapExcludeSources: isProd,
format: 'cjs',
exports: 'default',
},
external: ['obsidian', 'fs', 'os', 'path'],
plugins: [
typescript(),
resolve({
browser: true,
}),
replace({
"process.env.NODE_ENV": JSON.stringify(env.NODE_ENV),
preventAssignment: true,
}),
babel({
presets: ['@babel/preset-react', '@babel/preset-typescript'],
babelHelpers: 'bundled',
}),
commonjs(),
],
};