Skip to content

Commit

Permalink
customName 参数添加透传 File 对象 (#413)
Browse files Browse the repository at this point in the history
对于复杂的项目,可能不同的 Source 文件,需要配置不同的 import path
  • Loading branch information
chhu1 committed Mar 25, 2020
1 parent 667e85e commit 39afe42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class Plugin {
? transCamel(methodName, '-')
: methodName;
const path = winPath(
this.customName ? this.customName(transformedMethodName) : join(this.libraryName, libraryDirectory, transformedMethodName, this.fileName) // eslint-disable-line
this.customName ? this.customName(transformedMethodName, file) : join(this.libraryName, libraryDirectory, transformedMethodName, this.fileName) // eslint-disable-line
);
pluginState.selectedMethods[methodName] = this.transformToDefaultImport // eslint-disable-line
? addDefault(file.path, path, { nameHint: methodName })
Expand Down

0 comments on commit 39afe42

Please sign in to comment.