Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在关注“今日选择 ES6 模块”指南,我注意到他使用的其中一个导入语句的末尾有一个感叹号:
import 'bootstrap/css/bootstrap.css!';
那个感叹号是什么意思?
此导入语句出现在startup.js文件的第一行。
这意味着将调用插件来加载文件。默认情况下,插件/加载器名称等于扩展名。因此,在您的示例中,将调用css 插件bootstrap/css/bootstrap.css来加载文件。可以明确定义插件:
bootstrap/css/bootstrap.css
import 'bootstrap/css/bootstrap.css!css';
或者
import 'bootstrap/css/bootstrap.css!customCssLoader';
插件必须像任何其他普通模块一样安装。更多关于这里语法的信息。