swico 2.5.0-beta.3 → 2.5.0-beta.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/package.json +1 -1
- package/src/utils/config.js +3 -0
package/package.json
CHANGED
package/src/utils/config.js
CHANGED
|
@@ -134,6 +134,8 @@ exports.getProjectConfig = getProjectConfig;
|
|
|
134
134
|
const initCliEntryFile = (projectPath, templateType, env) => __awaiter(void 0, void 0, void 0, function* () {
|
|
135
135
|
const entryFilePath = path_1.default.resolve(projectPath, './.swico/index.js');
|
|
136
136
|
let replaceEntryText = yield fs_extra_1.default.readFile(entryFilePath, 'utf8');
|
|
137
|
+
const entryFileTypesPath = path_1.default.resolve(projectPath, './.swico/index.d.ts');
|
|
138
|
+
const entryFileTypesText = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, `../index.${templateType}.d.ts`), 'utf8');
|
|
137
139
|
const formatHooksPath = path_1.default
|
|
138
140
|
.resolve(projectPath, './.swico/hooks')
|
|
139
141
|
.replaceAll('\\', '/');
|
|
@@ -147,6 +149,7 @@ const initCliEntryFile = (projectPath, templateType, env) => __awaiter(void 0, v
|
|
|
147
149
|
.replaceAll('\\', '/');
|
|
148
150
|
replaceEntryText = replaceEntryText.replaceAll('require("./mock-history");', `require("${formatHistoryPath}");`);
|
|
149
151
|
yield fs_extra_1.default.writeFile(entryFilePath, replaceEntryText);
|
|
152
|
+
yield fs_extra_1.default.writeFile(entryFileTypesPath, entryFileTypesText);
|
|
150
153
|
});
|
|
151
154
|
const formatRouterConfig = ({ routes = [], type = 'browser', base = '/' }, templateType, env) => {
|
|
152
155
|
const projectPath = process.cwd();
|