1.0.1 • Published 6 years ago

fis3-preprocessor-babel-helper v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

fis3-preprocessor-babel-helper

A preprocessor plugin for fis3 when using babel-plugin-external-helpers plugin.


使用 babel-plugin-external-helpers 时, 可以使用此插件自动提取依赖的 helper, 并自动注入require语句, 然后配合 fis3-prepackager-babel-helper 插件自动生成 babel_helper.js 文件。

Install

npm install fis3-preprocessor-babel-helper --save-dev

Add configure to fis-conf.js

fis.match('a.js', {
    preprocessor: fis.plugin('babel-helper', {
        helperFileId: 'widget/babel_helpers.js',  // 生成的 babel_helper.js 文件 id, namespace 通过下面的 namespace 字段单独配置
        namespace: fis.config.get('namespace')
    })
});

// 编译后, 会自动在 a.js 文件头注入   var babelHelpers = require('namespace:widget/babel_helpers.js');

Thanks fisx-preprocessor-babel

1.0.1

6 years ago

1.0.0

6 years ago