Answer the question
In order to leave comments, you need to log in
How to import js library?
When I connect the js-library in head everything works.
If I import it as a module, then the function assignment to window (window.libraryName.foo ()) falls off
. What could be the matter?
What is the difference between including in head and importing?
Answer the question
In order to leave comments, you need to log in
Why mankipatch window in modular code ?
Import the library into the file (module) in which you are using it.
import libraryName from 'libraryName';
libraryName.someMethod();
import { someMethod } from 'libraryName';
someMethod();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question