@uiwwsw/react-query-helper 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +6 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1957,14 +1957,17 @@ async function renderOptionsCode(params) {
|
|
|
1957
1957
|
template: config.template
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
1960
|
+
function stripTrailingIndex(modulePath) {
|
|
1961
|
+
return modulePath.replace(/(?:\/index|^index)$/, "") || ".";
|
|
1962
|
+
}
|
|
1960
1963
|
function resolveSourceImportPath(filePath, outputFile) {
|
|
1961
1964
|
const sourceModulePath = filePath.replace(new RegExp(`${extname3(filePath)}$`), "");
|
|
1962
|
-
const relativeSourcePath = normalizeModulePath(relative3(config.resolvedSourceDir, sourceModulePath));
|
|
1965
|
+
const relativeSourcePath = stripTrailingIndex(normalizeModulePath(relative3(config.resolvedSourceDir, sourceModulePath)));
|
|
1963
1966
|
if (config.sourceImportAlias) {
|
|
1964
1967
|
const aliasBase = config.sourceImportAlias.replace(/\/$/, "");
|
|
1965
|
-
return relativeSourcePath ? `${aliasBase}/${relativeSourcePath}
|
|
1968
|
+
return relativeSourcePath === "." ? aliasBase : `${aliasBase}/${relativeSourcePath}`;
|
|
1966
1969
|
}
|
|
1967
|
-
return normalizeModulePath(relative3(dirname4(outputFile), sourceModulePath) || ".", true);
|
|
1970
|
+
return stripTrailingIndex(normalizeModulePath(relative3(dirname4(outputFile), sourceModulePath) || ".", true));
|
|
1968
1971
|
}
|
|
1969
1972
|
async function processFile(filePath) {
|
|
1970
1973
|
if (!shouldProcess(filePath)) {
|