forked from SettingDust/obsidian-outliner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.mjs
36 lines (35 loc) · 1014 Bytes
/
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
import commonjs from "@rollup/plugin-commonjs";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import typescript from "@rollup/plugin-typescript";
import fs from "node:fs";
export default (commandLineArgs) => ({
input: commandLineArgs.configWithTests
? "src/ObsidianOutlinerPluginWithTests.ts"
: "src/ObsidianOutlinerPlugin.ts",
output: {
file: "main.js",
sourcemap: "inline",
format: "cjs",
exports: "default",
},
external: [
"obsidian",
"codemirror",
"@codemirror/state",
"@codemirror/view",
"@codemirror/language",
],
plugins: [
replace({
preventAssignment: true,
PLUGIN_VERSION: JSON.stringify(
JSON.parse(fs.readFileSync("./package.json", "utf-8")).version,
),
CHANGELOG_MD: JSON.stringify(fs.readFileSync("./CHANGELOG.md", "utf-8")),
}),
typescript(),
nodeResolve({ browser: true }),
commonjs(),
],
});