-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
67 lines (65 loc) · 1.49 KB
/
Copy pathtsdown.config.ts
File metadata and controls
67 lines (65 loc) · 1.49 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import UnoCSS from '@unocss/postcss';
import postcssMergeRules from 'postcss-merge-rules';
import { defineConfig } from 'tsdown';
import solid from 'unplugin-solid/rolldown';
import man from './manifest.json' with { type: 'json' };
const mode = process.env.MODE;
const dev = mode === 'dev';
const inspect = mode === 'inspect';
export default defineConfig({
clean: !dev && !inspect,
copy: [
{
from: 'manifest.json',
to: 'dist',
},
],
css: {
fileName: 'styles.css',
minify: true,
postcss: {
plugins: [UnoCSS(), postcssMergeRules()],
},
transformer: 'postcss',
},
define: {
'Bun.env.VERSION': JSON.stringify(man.version),
},
deps: {
neverBundle: [
'obsidian',
'electron',
'@codemirror/autocomplete',
'@codemirror/collab',
'@codemirror/commands',
'@codemirror/language',
'@codemirror/lint',
'@codemirror/search',
'@codemirror/state',
'@codemirror/view',
],
onlyBundle: false,
},
devtools: inspect,
entry: 'src/index.ts',
format: 'cjs',
inputOptions: {
resolve: {
// Obsidian plugins run in Electron with a DOM, but CJS resolution can still
// Select Solid's server runtime. Force the browser runtime explicitly.
alias: {
'hash-wasm': 'hash-wasm/dist/index.esm.js',
'solid-js/web': 'solid-js/web/dist/web.js',
},
conditionNames: ['browser', 'import', 'module', 'default'],
},
},
minify: true,
outputOptions: {
codeSplitting: false,
file: 'dist/main.js',
},
platform: 'browser',
plugins: [solid()],
target: 'es2024',
});