diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-17 23:47:10 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-17 23:47:10 +0800 |
commit | 12f3a81cf12c6ffc24a7f2a0e8102dfba3fddf82 (patch) | |
tree | e554b5859e0135b8f644986768306d5f3ee5683e /babel-import-promise | |
parent | 7997c067ab6a69ef587a40c244caf36805a00e8c (diff) | |
download | SoopyV2-12f3a81cf12c6ffc24a7f2a0e8102dfba3fddf82.tar.gz SoopyV2-12f3a81cf12c6ffc24a7f2a0e8102dfba3fddf82.tar.bz2 SoopyV2-12f3a81cf12c6ffc24a7f2a0e8102dfba3fddf82.zip |
fix on linux
Diffstat (limited to 'babel-import-promise')
-rw-r--r-- | babel-import-promise/babel-import-promise.mjs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/babel-import-promise/babel-import-promise.mjs b/babel-import-promise/babel-import-promise.mjs index bdde752..10aee6a 100644 --- a/babel-import-promise/babel-import-promise.mjs +++ b/babel-import-promise/babel-import-promise.mjs @@ -19,7 +19,7 @@ export default function ({ types: t }) { }; path.traverse(MyVisitor) if (shouldAdd) { - let depth = state.filename.replace(state.cwd, "").split("\\").length - 2 + let depth = state.filename.replace(state.cwd, "").split(/[\\/]/g).length - 2 const identifier = t.identifier('Promise'); const importDefaultSpecifier = t.importDefaultSpecifier(identifier); const importDeclaration = t.importDeclaration([importDefaultSpecifier], t.stringLiteral("../".repeat(depth) + 'PromiseV2')); |