1.0.4 • Published 1 year ago

@bale-tools/compiler-file v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

文件转换框架

转换 .tsx.ts.js.lesssasscssvuees2015commonjs, 采用多线程打包。

使用

const compilerFile = require('@bale-tools/compiler-file')

/**
 * {
 *   path: '', // 文件路径
 *   excludes: [], // 过滤的文件, 可以是路径或通配符`**`
 *   isOtherRemove: false, // 其他文件是否删除
 *   isDemand: false, // 是否按需加载
 *   isTsProject: false, // 是否是 ts 项目
 *   outputTsMode: '', // 输出 ts 项目模式 commonjs | ES2015
 *   outputJsMode: '', // 输出 js 模式 commonjs | esmodule
 *   outputDirPath: '', // 输出目录名称或目录, 默认和项目同名
 *   isDeleteOutputDir: true, // 是否删除输出目录
 *   done: Function, // 结束函数
 *   everyCallback: Function, // 每一个回调函数, 多个文件才有回调
 * }
 */
compilerFile.compile({
  path: 'xxx/xxx',
  isTsProject: false,
  outputJsMode: 'commonjs',
})

发布到私服

npm login
npm publish --access public # 公开