@chialab/esbuild-rna
Advanced tools
Comparing version 0.15.37 to 0.15.38
import path from 'path'; | ||
import crypto from 'crypto'; | ||
import { mkdir, readFile, writeFile } from 'fs/promises'; | ||
import { appendSearchParam, escapeRegexBody } from '@chialab/node-resolve'; | ||
import { escapeRegexBody } from '@chialab/node-resolve'; | ||
import { loadSourcemap, inlineSourcemap, mergeSourcemaps } from '@chialab/estransform'; | ||
@@ -358,2 +358,19 @@ import { assignToResult, createOutputFile, createResult } from './helpers.js'; | ||
/** | ||
* Check if path has been emitted by build. | ||
* @param {string} path The path to check. | ||
*/ | ||
isEmittedPath(path) { | ||
for (const chunk of state.chunks.values()) { | ||
if (chunk.path === path) { | ||
return true; | ||
} | ||
} | ||
for (const file of state.files.values()) { | ||
if (file.path === path) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}, | ||
/** | ||
* Programmatically emit file reference. | ||
@@ -494,3 +511,3 @@ * @param {string} source The path of the file. | ||
...result, | ||
path: appendSearchParam(`./${path.relative(virtualOutDir, resolvedOutputFile)}`, 'emit', 'chunk'), | ||
path: `./${path.relative(virtualOutDir, resolvedOutputFile)}`, | ||
}; | ||
@@ -497,0 +514,0 @@ state.chunks.set(options.entryPoint, chunkResult); |
{ | ||
"name": "@chialab/esbuild-rna", | ||
"type": "module", | ||
"version": "0.15.37", | ||
"version": "0.15.38", | ||
"description": "A framework for esbuild plugins with transform and emit capabilities.", | ||
@@ -17,3 +17,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"types": "tsc", | ||
"types": "rimraf './{types,*.tsbuildinfo}' && tsc -b", | ||
"prepack": "yarn types" | ||
@@ -37,5 +37,5 @@ }, | ||
"esbuild": "^0.14.8", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.3.0" | ||
}, | ||
"gitHead": "c6158f6389f7ddeb04c7015a2d63c5243442407a" | ||
} | ||
} |
@@ -71,2 +71,7 @@ /// <reference types="node" /> | ||
/** | ||
* Check if path has been emitted by build. | ||
* @param {string} path The path to check. | ||
*/ | ||
isEmittedPath(path: string): boolean; | ||
/** | ||
* Programmatically emit file reference. | ||
@@ -73,0 +78,0 @@ * @param {string} source The path of the file. |
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
38413
949
3