fis-parser-jdists

2.2.3 • Public • Published

fis-parser-jdists

Build Status NPM version

fis 插件 - jdists 代码块预处理

背景

一般的项目会在多个地方进行发布,比如线上环境、内网环境、本地环境,除了配置以外。我们还希望能将特定的代码区块裁剪掉。

定义

js 区域定义

/*<debug>*/
console.log(debug);
/*</debug>*/

css 区域定义

#panel {
/*<debug>*/
  background-color: red;
/*</debug>*/
}

html 区域定义

<!--debug-->
<span>测试版本,请勿对外公开</span>
<!--/debug-->

函数注释字符 区域定义

function() {/*!
<div>
  <a href="#{url}">#{title}</a>
  <button>cancel</button><button>download</button>
</div>
  */}

使用

fis2

安装 npm install fis-parser-jdists

fis.config.set('modules.parser.js', 'fis-parser-jdists');
fis.config.set('settings.parser', [{
  "remove": "debug,test"
}]);

fis3

fis.match('*.js', {
  parser: fis.plugin('jdists', {
    remove: "debug,test"
  })
})

更详细的用法请参考:https://github.com/zswang/jdists

Readme

Keywords

Package Sidebar

Install

npm i fis-parser-jdists

Weekly Downloads

3

Version

2.2.3

License

MIT

Unpacked Size

3.9 kB

Total Files

5

Last publish

Collaborators

  • 2betop
  • zswang