Skip to content

Commit 6a90e0c

Browse files
eternal-flame-ADjmattheis
authored andcommitted
decorator workaround
1 parent b973bf5 commit 6a90e0c

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
"testformat": "prettier \"src/**/*.{ts,tsx}\" --list-different"
4848
},
4949
"devDependencies": {
50+
"@babel/plugin-proposal-decorators": "^7.29.0",
5051
"@eslint/js": "^10.0.0",
52+
"@rolldown/plugin-babel": "^0.2.2",
5153
"@types/notifyjs": "^3.0.5",
5254
"@types/react": "^19.1.9",
5355
"@types/react-dom": "^19.1.7",

ui/vite.config.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
import {defineConfig} from 'vite';
22
import react from '@vitejs/plugin-react';
3+
import babel from '@rolldown/plugin-babel';
34

45
const GOTIFY_SERVER_PORT = process.env.GOTIFY_SERVER_PORT ?? '80';
56

7+
function decoratorPreset(options: Record<string, unknown>) {
8+
return {
9+
preset: () => ({
10+
plugins: [['@babel/plugin-proposal-decorators', options]],
11+
}),
12+
rolldown: {
13+
filter: {code: '@'},
14+
},
15+
};
16+
}
17+
618
export default defineConfig({
719
base: './',
820
build: {
@@ -11,7 +23,12 @@ export default defineConfig({
1123
sourcemap: false,
1224
assetsDir: 'static',
1325
},
14-
plugins: [react()],
26+
plugins: [
27+
react(),
28+
babel({
29+
presets: [decoratorPreset({version: '2022-03'})],
30+
}),
31+
],
1532
define: {
1633
// Some libraries use the global object, even though it doesn't exist in the browser.
1734
// Alternatively, we could add `<script>window.global = window;</script>` to index.html.

0 commit comments

Comments
 (0)