I have several js files, and each file is a standonlone function with a unique name, and I want to pack all these files in one set. Therefore i am doing this code
module.exports = { entry: { app:[ './file1.js', './file2.js', './file3.js', './file4.js' ], }, output: { path: './dist/', filename: '[name].bundle.js' } };
which work, and I have the package file ".dist / app.bundle.js"
Now I have js code in the body of HTML that should call functions in the package. If I try to call the function "functionA" (that is, in file1.js file), I get this message in the browser console
Uncaught ReferenceError: functionA is not defined
The question is, how can I export my functions from a package in order to import it into my HTML code?
source share