最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ES6 imports - what does the exclamation mark mean? - Stack Overflow

programmeradmin6浏览0评论

I'm following along with the Choose ES6 Modules Today guide, and I noticed one of the import statements he's using has an exclamation mark at the end:

import 'bootstrap/css/bootstrap.css!';

What does that exclamation mark signify?

This import statement appears on the first line of the startup.js file.

I'm following along with the Choose ES6 Modules Today guide, and I noticed one of the import statements he's using has an exclamation mark at the end:

import 'bootstrap/css/bootstrap.css!';

What does that exclamation mark signify?

This import statement appears on the first line of the startup.js file.

Share Improve this question asked Jul 24, 2015 at 21:24 Lukas S.Lukas S. 5,7585 gold badges36 silver badges51 bronze badges 2
  • im guessing that means don't execute as javascript. – Daniel A. White Commented Jul 24, 2015 at 21:29
  • 3 Please note that neither the module loader nor how it should interpret module identifiers are specified in the standard. This is all specific to the module loader you are using (e.g. systemjs) not ECMAScript. – Felix Kling Commented Jul 25, 2015 at 0:16
Add a comment  | 

1 Answer 1

Reset to default 23

It means that a plugin will be called to load the file. By default the plugin/loader name equals the extension name. So in your example the css plugin will be called to load the bootstrap/css/bootstrap.css file. One can define the plugin explicitly:

import 'bootstrap/css/bootstrap.css!css';

or

import 'bootstrap/css/bootstrap.css!customCssLoader';

Plugins have to be installed like any other normal module. More about this syntax here.

发布评论

评论列表(0)

  1. 暂无评论