How does importing module in JavaScript works?

63 Views Asked by At

I want to know the difference between :

import 'any module which is in node_module';

import 'any module which is in vendor folder';

require('any module in node_module');

require('module in vendor folder');

I know that require function needs require.js. But sometimes, in projects, there is no require.js. But there is system.js.

Then what is the difference between require.js and system.js ?

Thank you

1

There are 1 best solutions below

0
On

Both are module loaders . They will load javascript modules in a lazy load manner.