Include standard "old style" javascript


#1

Hi,
i am planning to use NativeScript to implement an old project made with cordova + ionic 1.0

The problem is i don’t know how to import standard javascript libraries (classic import with )

Not all libraries i previously used (and made) are in form of npm package. Is there a way to make a “standard” library javascript inclusion?

Thanks


#2

You may copy any JavaScript files / modules (that is not browser dependent) to your app folder, use it as a library with just a require statement.


#3

hi manojdcoder,
you mean to import like
import * as from ‘library.path.js’ ?

I believed this could be done only for npm packaged libraries only

By the way thanks for reply


#4

NPM has nothing to do with that, it’s just ES6 import statement applicable for any common js modules. One thing besides, usually you don’t include .js in path.