what's mean “!” in require.js

前端 未结 2 1392
南方客
南方客 2021-01-15 00:26

What\'s mean \"!\" in require.js when I included module ? What\'s syntax ? I what includ dinamic stylesheet in my project and I found https://github.com/martinsb/require-cs

相关标签:
2条回答
  • 2021-01-15 00:40

    By default requirejs has support for downloading and loading javascript files only. Any other file which need to be downloaded and parsed accordingly is done by means of plugins. These plugins are separate javascript files which know how to download and parse the respected file.

    To tell requirejs that any particular file need to be handled by separate plugin and not default loader. It's plugin is appended with ! between plugin name and file path.

    0 讨论(0)
  • 2021-01-15 00:59

    ! means that css plugin will be used to parse sample.css.

    Syntax is <plugin-name>!<file-path>.

    css.js file contains css plugin's code.

    css/sample.css is file, that should be loaded using that plugin.

    See https://github.com/millermedeiros/requirejs-plugins

    0 讨论(0)
提交回复
热议问题