The content of this section is derived from the content of the following links and is subject to the CC BY 4.0 license.
The following contents can be assumed to be the result of modifications and deletions based on the original contents if not specifically stated.
Automatically load modules instead of having to import
or require
them everywhere.
or
By default, module resolution path is current folder (./**
) and node_modules
.
It is also possible to specify full path:
Whenever the identifier
is encountered as free variable in a module, the module
is loaded automatically and the identifier
is filled with the exports of the loaded module
(or property
in order to support named exports).
For importing the default export of an ES2015 module, you have to specify the default property of module.
Record<string, string | string[]>
Enable process
object support within a browser context.
the piece of code:
will be transformed behind the scenes to:
To automatically load jquery
we can point both variables it exposes to the corresponding node module:
Then in any of our source code: