It seems like the function "MakeChangeOnData" is not being included in the compiled file. One solution could be to explicitly import the file containing the function in the main entry file for Vite.
Assuming the file containing the function is named "mycustom.js" and is located in the "/resources/js" directory, you can add the following import statement in your main entry file (e.g. "app.js"):
import './mycustom.js';
This will ensure that the "mycustom.js" file is included in the compiled file and the "MakeChangeOnData" function is defined.
Alternatively, you can try adding the "mycustom.js" file to the "scripts" section of your package.json file, like so:
"scripts": {
"dev": "vite",
"build": "vite build",
"mycustom": "vite build --mode=production --entry=resources/js/mycustom.js"
}
Then, run the following command to build the "mycustom.js" file separately:
npm run mycustom
This should generate a compiled file for "mycustom.js" that includes the "MakeChangeOnData" function.