babel-plugin-s2s-some-root-ts
plugin for https://github.com/akameco/s2s
Search the directory and create Root.
Install
$ npm install --save-dev babel-plugin-s2s-some-root-ts
Example
ExportType: union
IN:
OUT:
/***** Do not edit this file *****/;; ;
ExportType: object
IN:
OUT:
/***** Do not edit this file *****/;; ;
ExportType: array
IN:
OUT:
/***** Do not edit this file *****/;; ;
Usage
module.exports = {
watch: './**/*.ts',
plugins: [
{
test: /actionTypes.ts$/,
plugin: ['s2s-some-root-ts', {
input: 'containers/**/actionTypes.ts',
output: 'types/action.ts',
globOptions: {},
exportType: 'object',
importName: 'action',
exportName: 'actions',
prefix: 'pre_',
suffix: '_suf',
}],
},
],
}
input
type: string
required: true
glob pattern.
output
type: string
required: true
outputh path.
globOptions
type: object
required: false
See https://github.com/isaacs/node-glob#options
exportType
type: string
union|array|object
required: false
default: union
Switch output type. Please see examples.
importName
type: string
required: false
default: Directory name
Name to import from file. If not specified, the directory name is specified.
exportName
type: string
required: false
default: Root
Name to export variable (or alias).
prefix
type: string
required: false
default: empty
Prefix of export.
suffix
type: string
required: false
default: empty
Suffix of export.