swico 0.5.0-beta20 → 0.5.0-beta22
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/package.json +1 -1
- package/src/utils/config.js +6 -2
package/package.json
CHANGED
package/src/utils/config.js
CHANGED
|
@@ -220,7 +220,7 @@ var getFormatRouter = function (routes, templateType) {
|
|
|
220
220
|
});
|
|
221
221
|
};
|
|
222
222
|
var initCliIndexFile = function (templateType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
223
|
-
var targetPath, targetTypesPath, replaceFileText, fileTypesText;
|
|
223
|
+
var targetPath, targetTypesPath, replaceFileText, fileTypesText, formatHooksPath;
|
|
224
224
|
return __generator(this, function (_a) {
|
|
225
225
|
switch (_a.label) {
|
|
226
226
|
case 0:
|
|
@@ -229,7 +229,11 @@ var initCliIndexFile = function (templateType) { return __awaiter(void 0, void 0
|
|
|
229
229
|
replaceFileText = fs_extra_1.default.readFileSync(path_1.default.resolve(__dirname, "../index.".concat(templateType, ".js")), 'utf8');
|
|
230
230
|
fileTypesText = fs_extra_1.default.readFileSync(path_1.default.resolve(__dirname, "../index.".concat(templateType, ".d.ts")), 'utf8');
|
|
231
231
|
if (templateType === 'react') {
|
|
232
|
-
|
|
232
|
+
formatHooksPath = path_1.default
|
|
233
|
+
.resolve(projectPath, './src/.swico/hooks')
|
|
234
|
+
.replaceAll('\\', '/');
|
|
235
|
+
console.log('formatHooksPath', formatHooksPath);
|
|
236
|
+
replaceFileText = replaceFileText.replaceAll('require("./template/react/hooks");', "require(\"".concat(formatHooksPath, "\");"));
|
|
233
237
|
}
|
|
234
238
|
return [4, (0, tools_1.writeFile)(targetPath, replaceFileText)];
|
|
235
239
|
case 1:
|