The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
How to make an import works in js file
Environment: VS Code.
I have a tester.js as following:
import without from ‘lodash’;
function Tester ()
// var output = without([1, 2, 3], 1);
console.log(“tester is called!”);
in a html file, I have
< script src=“tester.js”> < /script>
< scrip t>
var tester = new Tester();
The run will shows error:
ReferenceError: Tester is not defined
If I comment out the import line in tester.js, I got correct print out: tester is called!
(This isn’t about