为什么在 main.js 文件中导入了 bootstrap 模块?

Why there is import of bootstrap module in the main.js file?

我在 Aurelia main.js 文件中看到大多数设置 import 'bootstrap';。 问题是为什么会这样?它是否为我们的应用程序提供了 bootstrap 的一些额外用法,例如我们不能将其包含在 app.js 中吗?

此行加载 bootstrap 的 javascript 文件。 None 的功能在 main.js 中是必需的,但它是响应式菜单栏等功能所必需的,因此使用了 import 'bootstrap';。这样做只是加载并运行文件,但实际上并没有将任何功能引入当前模块。

我们做同样的事情来加载 fetch polyfill import 'fetch';