Skip to content

Commit

Permalink
chore: fix custom build with zwave-js (#3354)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Oct 20, 2023
1 parent aeedd90 commit 97c89a6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
19 changes: 19 additions & 0 deletions esbuild-register.js
Original file line number Diff line number Diff line change
@@ -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,
},
},
})
6 changes: 3 additions & 3 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default defineConfig(({ mode }) => {
replacement: `${path.resolve(__dirname, 'src')}/$1`,
},
],
preserveSymlinks: true,
},
define: {
__APP_ENV__: JSON.stringify(env.APP_ENV),
Expand Down

0 comments on commit 97c89a6

Please sign in to comment.