Skip to content

tech: enable watch mode & esbuild server in dev mode#674

Draft
ErwanRaulo wants to merge 1 commit intoNodeSecure:masterfrom
ErwanRaulo:watch-mode
Draft

tech: enable watch mode & esbuild server in dev mode#674
ErwanRaulo wants to merge 1 commit intoNodeSecure:masterfrom
ErwanRaulo:watch-mode

Conversation

@ErwanRaulo
Copy link
Contributor

@ErwanRaulo ErwanRaulo commented Mar 10, 2026

what it does

esbuild config to watch and serve fle for auto reload on served files changes.

features

  • build, watch, serve and opens web app using an nsecure result existing file.
    or
  • build, watch, serve and opens web app but nsecure command should be ran to open the esbuild server with generated result file.

commands tested : nsecure auto

to validate:

  • 2 esbuild config VS 1 file with process arg (-dev) ? Or use base config ?

to fix:

  • [ x] searchbar not visible when opening the server ip address after payload extraction.

@clemgbld clemgbld requested review from PierreDemailly and fraxken and removed request for fraxken March 11, 2026 09:22
@fraxken
Copy link
Member

fraxken commented Mar 11, 2026

Not a big fan of duplicating code (http etc)

Comment on lines -66 to +57
httpServer.listen(httpPort, async() => {
const link = `http://localhost:${httpServer.address().port}`;
console.log(kleur.magenta().bold(await i18n.getToken("cli.http_server_started")), kleur.cyan().bold(link));

open(link);
});
if (enableDeveloperMode) {
// todo: ping/warn if dev server is not up & running
open("http://127.0.0.1:8080");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm there is something wrong with how the code is modified here. Before we had a clean open but now only one simple open when enabledDeveloperMode is true?

Copy link
Contributor Author

@ErwanRaulo ErwanRaulo Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, not really what i wanted to do, it miss the translation for dev mode, keeping the clean open in place.

watch esbuild config file now it opens the link like this with current nsecure result.
so maybe we should tell something in scenarios like:

  • "dev server not running ?"
  • " dev server listening on ...."

@ErwanRaulo
Copy link
Contributor Author

Not a big fan of duplicating code (http etc)

i ended up removing duplication.

@ErwanRaulo ErwanRaulo force-pushed the watch-mode branch 2 times, most recently from 2971aff to 83933fe Compare March 11, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants