vueless 1.3.7-beta.1 → 1.3.7-beta.2
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/utils/node/helper.js +6 -5
package/package.json
CHANGED
package/utils/node/helper.js
CHANGED
|
@@ -252,10 +252,11 @@ export async function detectTypeScript() {
|
|
|
252
252
|
* @return {Promise<void>} A promise that resolves when the configuration import and index file generation is completed.
|
|
253
253
|
*/
|
|
254
254
|
export async function autoImportUserConfigs(basePath = "") {
|
|
255
|
+
const vuelessAppDir = path.join(cwd(), basePath, VUELESS_APP_DIR);
|
|
255
256
|
const vuelessConfigDir = path.join(cwd(), basePath, VUELESS_APP_CONFIGS_DIR);
|
|
256
257
|
|
|
257
|
-
const indexTsPath = path.join(
|
|
258
|
-
const indexJsPath = path.join(
|
|
258
|
+
const indexTsPath = path.join(vuelessAppDir, `${CONFIG_INDEX_FILE_NAME}${TYPESCRIPT_EXT}`);
|
|
259
|
+
const indexJsPath = path.join(vuelessAppDir, `${CONFIG_INDEX_FILE_NAME}${JAVASCRIPT_EXT}`);
|
|
259
260
|
|
|
260
261
|
const hasTypeScript = await detectTypeScript();
|
|
261
262
|
|
|
@@ -282,7 +283,7 @@ export async function autoImportUserConfigs(basePath = "") {
|
|
|
282
283
|
if (componentConfigFiles.length) {
|
|
283
284
|
for (const configFilePath of componentConfigFiles) {
|
|
284
285
|
const fileName = path.basename(configFilePath, path.extname(configFilePath));
|
|
285
|
-
const relativePath = path.relative(
|
|
286
|
+
const relativePath = path.relative(vuelessAppDir, configFilePath);
|
|
286
287
|
const importPath = "./" + relativePath.replace(/\\/g, "/");
|
|
287
288
|
|
|
288
289
|
imports.push(`import ${fileName} from "${importPath}";`);
|
|
@@ -290,8 +291,8 @@ export async function autoImportUserConfigs(basePath = "") {
|
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
293
|
|
|
293
|
-
if (!existsSync(
|
|
294
|
-
await mkdir(
|
|
294
|
+
if (!existsSync(vuelessAppDir)) {
|
|
295
|
+
await mkdir(vuelessAppDir, { recursive: true });
|
|
295
296
|
}
|
|
296
297
|
|
|
297
298
|
const indexFileContent = await generateConfigIndexContent(imports, componentEntries);
|