@digitak/esrun
Advanced tools
Comparing version 3.2.5 to 3.2.6
{ | ||
"name": "@digitak/esrun", | ||
"version": "3.2.5", | ||
"version": "3.2.6", | ||
"type": "module", | ||
@@ -19,3 +19,3 @@ "description": "Execute directly your Typescript files using Esbuild", | ||
"dev": "./package/bin.js --watch test --watch coco", | ||
"test": "./package/bin.js test --watch coco", | ||
"test": "./package/bin.js test/index.mts --watch coco", | ||
"test:watch": "./package/bin.js --watch:test/*.json test --watch coco", | ||
@@ -22,0 +22,0 @@ "test:watch:preserve": "./package/bin.js --preserveConsole --watch:test/*.json test --watch coco", |
@@ -8,3 +8,3 @@ import path from "path"; | ||
setup(build) { | ||
build.onLoad({ filter: /.\.(js|ts|jsx|tsx)$/, namespace: "file" }, async (options) => { | ||
build.onLoad({ filter: /.\.(c|m)?(js|ts)x?$/, namespace: "file" }, async (options) => { | ||
const isWindows = /^win/.test(process.platform); | ||
@@ -16,5 +16,8 @@ const escape = (path) => (isWindows ? path.replace(/\\/g, "/") : path); | ||
const contents = grub(fileContent).replace({ from: "__dirname", to: `"${dirname}"` }, { from: "__filename", to: `"${filename}"` }); | ||
let loader = path.extname(options.path).slice(1); | ||
if (["m", "c"].includes(loader[0])) | ||
loader = loader.slice(1); | ||
return { | ||
contents, | ||
loader: path.extname(options.path).slice(1), | ||
loader, | ||
}; | ||
@@ -21,0 +24,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24786
433