npm, node.js Flashcards

1
Q

How to automatically copy assets during/before build?

A

All assets of package must be copied to parent project.

In Angular usually it is done by assets config inside angular.json, but better approach is to use npm-assets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is ECMA2015 module?

A

A module, in a nutshell, is a JavaScript file that operates in a sandbox environment and exposes some values to the public. It’s a normal JavaScript file with import statements to import modules and export statements to make a value (such as variable, function, class, etc.) available for import.

TypeScript supports the EcmaScript module syntax which means you will be using modules in TypeScript using import and export keyword which is very convenient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is module resolution?

A

Whether a relative path or non-relative path, when the TypeScript compiler encounters a import statement, it starts looking for a module file to import in the file system. The lookup process is called module resolution. Depending on the path of a module, relative or non-relative, the TypeScript compiler takes a different approach to look for the module file. This approach is called a module resolution strategy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly