mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
fix: improved support for cjs and cts modules (#26558)
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
4774eab64d
commit
826e42a5b5
143 changed files with 2418 additions and 1527 deletions
|
@ -22,7 +22,13 @@ pub trait NpmResolver: std::fmt::Debug + MaybeSend + MaybeSync {
|
|||
specifier: &str,
|
||||
referrer: &Url,
|
||||
) -> Result<PathBuf, errors::PackageFolderResolveError>;
|
||||
}
|
||||
|
||||
#[allow(clippy::disallowed_types)]
|
||||
pub type InNpmPackageCheckerRc = crate::sync::MaybeArc<dyn InNpmPackageChecker>;
|
||||
|
||||
/// Checks if a provided specifier is in an npm package.
|
||||
pub trait InNpmPackageChecker: std::fmt::Debug + MaybeSend + MaybeSync {
|
||||
fn in_npm_package(&self, specifier: &Url) -> bool;
|
||||
|
||||
fn in_npm_package_at_dir_path(&self, path: &Path) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue