diff --git a/esbuild-register.js b/esbuild-register.js new file mode 100644 index 0000000000..fe3ef3752a --- /dev/null +++ b/esbuild-register.js @@ -0,0 +1,19 @@ +'use strict' + +const { register } = require('esbuild-register/dist/node') + +register({ + hookMatcher(f) { + return f.endsWith('.ts') + }, + // Prevent esbuild from adding a "2" to the names of CC classes for some reason. + keepNames: true, + // Target the correct node version in transpilation + target: `node${process.versions.node}`, + // Stick to legacy decorators for now + tsconfigRaw: { + compilerOptions: { + experimentalDecorators: true, + }, + }, +}) diff --git a/nodemon.json b/nodemon.json index 75caa3afa4..f978108a1e 100644 --- a/nodemon.json +++ b/nodemon.json @@ -1,6 +1,6 @@ { - "watch": ["**/*.ts", "package.json", "tsconfig.json"], - "ext": "ts,json", + "watch": ["**/*.ts", "package.json", "tsconfig.json", "../node-zwave-js/packages/*/build/**/*.js"], + "ext": "ts,json,js", "ignore": ["pkg", "store", "node_modules", "src", "dist", "server"], - "exec": "node --inspect=7004 --trace-warnings -r esbuild-register bin/www.ts" + "exec": "node --inspect=7004 --trace-warnings -r ./esbuild-register bin/www.ts" } diff --git a/vite.config.js b/vite.config.js index 4e204fae93..645e7603cb 100644 --- a/vite.config.js +++ b/vite.config.js @@ -87,6 +87,7 @@ export default defineConfig(({ mode }) => { replacement: `${path.resolve(__dirname, 'src')}/$1`, }, ], + preserveSymlinks: true, }, define: { __APP_ENV__: JSON.stringify(env.APP_ENV),