fis3-prepackager-css2js
v1.0.3
Published
compile cssstyles into js module
Downloads
5
Readme
fis3-prepackager-css2js
将css编译成js模块的fis3插件
Usage
fis.match('::package', {
prepackager: fis.plugin('css2js',options)
});
- options.includeRE
模块ID的过滤器,必须传入正则
,比如要把 component/**/*.css
转化为js模块,那么正则就是
includeRE: /component\/(.*\.css)$/
- options.wrapType
css转化为js后,模块的包裹规范,分三种形式:amd
、cmd
和scrat
,分别如下:
//amd
define('component/test/test.css', function(){
return '#test{width:100%}'
});
//cmd
define('component/test/test.css', function(require, exports, module){
module.exports = '#test{width:100%}'
});
//scrat
require.defineCSS('component/test/test.css', '#test{width:100%}');
经过fis编译,css将后保存为类似 component/test/test.css.js
的文件名。
License
MIT.