EJS - I can't run .ejs on netlify

I tried to run .ejs file on netlify
and I imported files from github

Here’s my github link - https://github.com/mineppl12/any-duck

as you see, in my build.js file,

path: ${__dirname}/views/room.ejs,
outPath: ${__dirname}/public/index.html

However, if I run this,

    const ROOM_ID = "<%= roomId %>";

roomId is not defined

If i run this in
nodemon, nodemon server.js
there’s no problem at all.

Any idea to resolve this?

@mineppl12 Welcome to the Netlify community.

I’m not familiar with EJS, but if it needs a server to function, then it won’t work via the Netlify CDN-only delivery mechanism.