Answer the question
In order to leave comments, you need to log in
NextJS: How to import JS libraries?
I am writing a project in TypeScript using NextJs (under the hood it has WebPack).
You need to import a library that is not designed as a js module.
This library stupidly creates variables and functions in its scope and that's it:
// my-library.js
var var1 = ...
function fn1() { ... }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question