fis3-hook-annotation

0.0.8 • Public • Published

fis3-hook-annotation

使用注解修改fis文件属性, 精简fis-conf.js

Demo

/**
 * @moduleId "${subpath}"
 */
module.exports = {
    // ...
};
// fis-conf.js
fis.hook('annotation');

语法

@annotation[:media] [param]..

API

所有文件

@setProperty name value

file[`name`] = `value` // 设置任意属性

@noParser

file.parser = null // 取消scss/es6 babel等parser

@noOptimizer

file.optimizer = null // 取消min压缩

@releaseTo release

file.release = `release`

js文件

@noWrap

file.wrap = false // 将不会被CommonJs使用define包裹

@noMod

file.isMod = false

@moduleId moduleId

file.moduleId = `moduleId`

@es6

file.parser = fis.plugin('babel')  // babel

@uglify

file.optimizer = fis.plugin('uglify-js') // uglify压缩

@useRaw

file.wrap = false;  // 不被define包裹
file.parser = null; // 取消parser
file.optimizer = null; // 取消min压缩

css文件

@useRaw

file.parser = null; // 取消parser
file.optimizer = null; // 取消min压缩

html文件

Note

  • 注解需放在文件第一个块注释中

Readme

Keywords

Package Sidebar

Install

npm i fis3-hook-annotation

Weekly Downloads

0

Version

0.0.8

License

BSD

Last publish

Collaborators

  • feix760
  • imweb