Exports in javasript using webpack does not work

Hi all,

I started to code my old lua scripts in ( javascript /typescript ) using webpack
I’m exporting some functions following the example in the documentation


This is an example: script.js

exports("sayHello", (text) => {

When i run the script and open the game console i see this error:
TypeError: exports is not a function

I assume it’s trying to use the exports variable from nodejs or webpack env not the one from fivem core

Can anyone help me with this issue?
Thank you !