This website requires JavaScript.
Explore
Help
Sign in
foster
/
denoland-deno
Watch
1
Star
0
Fork
You've already forked denoland-deno
0
mirror of
https://github.com/denoland/deno.git
synced
2024-12-03 17:08:35 -05:00
Code
Issues
Packages
1
Wiki
Activity
c5887708a9
denoland-deno
/
tests
/
specs
/
compile
/
detect_cjs
/
add.js
4 lines
93 B
JavaScript
Raw
Normal View
History
Unescape
Escape
feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": "commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`).
2024-10-14 20:48:39 -04:00
module
.
exports
.
add
=
function
(
a
,
b
)
{
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>
2024-11-01 12:27:00 -04:00
return
require
(
"./subtract.ts"
)
.
subtract
(
a
,
-
b
)
;
feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": "commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`).
2024-10-14 20:48:39 -04:00
}
;
Copy permalink