ohmygod ohmygod - 7 months ago 121
Node.js Question

how to import external .js file in webpack with react?

Here is a file named tableau.js without npm package. I want to use it in my project? However, I cann't solve this problem. Please help me and show me correct ways. Thanks!

Answer Source

You need to use export module to export variables and functions from a file to another. Import your stuff to your main file. See https://www.sitepoint.com/understanding-module-exports-exports-node-js/

You could also use http://www.tutorialsteacher.com/nodejs/nodejs-module-exports

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download