DEV Community 👩‍💻👨‍💻

T-Kisaku
T-Kisaku

Posted on

How to reload express.js server with esbuild

Hello!!
I'm trying to develop web server made of express.js. And I want to use esbuild as bundler, but esbuild don't have feature to realod server. So I tried to add the feature.

Finally, I used nodemon. Like below.

{
    "watch": [
        "src"
    ],
    "ignore": [
        "dist",
        "node_modules"
    ],
    "ext": "ts,mjs,js,json,graphql",
    "exec": "yarn build && yarn start",
    "legacyWatch": true
}
Enter fullscreen mode Exit fullscreen mode

But it isn't best way to reload because that code regenerate all code... ... If you have another solution, I want to know that!!

Oldest comments (0)

🌚 Friends don't let friends browse without dark mode.

Just kidding, it's a personal preference. But you can change your theme, font, etc. in your settings.

The more you know. 🌈