At the beginning of my app.js
file, I include the line
import * as bootstrap from '../../node_modules/bootstrap';
After calling console.log(bootstrap)
on the following line, I can confirm that the bootstrap
variable contains an object resembling Bootstrap with all the expected properties.
The mystery lies in how this works, considering that node_modules\bootstrap
is simply a directory.
|- node_modules
|-> bootstrap
|-> dist [dir]
|-> js [dir]
|-> scss [dir]
|-> LICENCE [txt file]
|-> package.json
|-> README.md
So, how does the system determine what to import into the bootstrap
variable?
This question stems from curiosity about the inner workings of this process, as it undeniably functions correctly.
EDIT: (directory structure was modified after the original post)