@klevn/jxc
Advanced tools
Comparing version
import { execSync } from "child_process"; | ||
import { join, parse, resolve } from "path"; | ||
import { construct } from "./compiler.js"; | ||
import { tryCatch, getNames } from "./utils/utils.js"; | ||
import { tryCatch, getNames, addExtension } from "./utils/utils.js"; | ||
import * as fs from "fs"; | ||
@@ -56,3 +56,3 @@ import { pathToFileURL } from "url"; | ||
if (path.name == "index.js") { | ||
const rootComponent = (await tryCatch(async () => import(pathToFileURL(source).toString()))).default; | ||
const rootComponent = (await tryCatch(async () => import(addExtension(pathToFileURL(source).toString(), "js")))).default; | ||
if (!rootComponent) | ||
@@ -59,0 +59,0 @@ continue; |
@@ -10,2 +10,3 @@ export declare function trailingSemicolon(target: string, semicolon: boolean): string; | ||
}; | ||
export declare function addExtension(path: string, extension: string): string; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -99,1 +99,6 @@ import { minify as minifyJavascriptUnsafe } from "uglify-js"; | ||
} | ||
export function addExtension(path, extension) { | ||
if (path.endsWith(`.${extension}`)) | ||
return path; | ||
return `${path}.${extension}`; | ||
} |
@@ -127,2 +127,7 @@ import { minify as minifyJavascriptUnsafe } from "uglify-js" | ||
return { __dirname, __filename } | ||
} | ||
export function addExtension(path:string, extension:string) { | ||
if (path.endsWith(`.${extension}`)) return path | ||
return `${path}.${extension}` | ||
} |
@@ -35,3 +35,3 @@ { | ||
"name": "@klevn/jxc", | ||
"version": "38.2.5", | ||
"version": "38.2.6", | ||
"main": "./dist/compiler.js", | ||
@@ -38,0 +38,0 @@ "types": "./dist/compiler.d.ts", |
@@ -5,3 +5,3 @@ import { execSync } from "child_process" | ||
import { tryCatch, getNames } from "./utils/utils.js" | ||
import { tryCatch, getNames, addExtension } from "./utils/utils.js" | ||
@@ -76,3 +76,5 @@ | ||
if (path.name == "index.js"){ | ||
const rootComponent = (await tryCatch(async () => import(pathToFileURL(source).toString()))).default | ||
const rootComponent = (await tryCatch(async () => import( | ||
addExtension(pathToFileURL(source).toString(), "js") | ||
))).default | ||
@@ -79,0 +81,0 @@ if (!rootComponent) continue |
@@ -127,2 +127,7 @@ import { minify as minifyJavascriptUnsafe } from "uglify-js" | ||
return { __dirname, __filename } | ||
} | ||
export function addExtension(path:string, extension:string) { | ||
if (path.endsWith(`.${extension}`)) return path | ||
return `${path}.${extension}` | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
79659
0.88%2010
0.8%