1

I'm using 'yet-another-webpack-es6-starterkit' as my build kit. Unmodified, no changed package.json settings.

The code works well on its own but I need to export a function in the main index.js file so the function can be used by other js files in a node environment.

This is the example code I used for how to export: In Node.js, how do I "include" functions from my other files?

I created a test function called 'test' in the index.js.

module.exports = {
test: function () {
    var r = 42;
    return r;
}

};

But the external file cannot find the function. It doesn't seem to be visible from outside the js file.

Acorman
  • 91
  • 7

0 Answers0