We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
wasm
1 parent 2a44106 commit 43d3244Copy full SHA for 43d3244
shared/utils/package-analysis.ts
@@ -2,7 +2,7 @@
2
* Package analysis utilities for detecting module format and TypeScript support
3
*/
4
5
-export type ModuleFormat = 'esm' | 'cjs' | 'dual' | 'unknown'
+export type ModuleFormat = 'esm' | 'cjs' | 'dual' | 'wasm' | 'unknown'
6
7
export type TypesStatus =
8
| { kind: 'included' }
@@ -87,6 +87,11 @@ export function detectModuleFormat(pkg: ExtendedPackageJson): ModuleFormat {
87
88
return mainIsCJS ? 'dual' : 'esm'
89
}
90
+
91
+ const mainIsWASM = pkg.main?.endsWith('.wasm')
92
+ if (mainIsWASM) {
93
+ return 'wasm'
94
+ }
95
96
if (hasModule || isTypeModule) {
97
return 'esm'
0 commit comments