@jcoreio/toolchain 5.6.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -14,22 +14,26 @@ module.exports = [
|
|
|
14
14
|
return path
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
const dtsExtension = packageJson.type === 'module' ? '.d.cts' : '.d.ts'
|
|
18
|
+
const cjsExtension = packageJson.type === 'module' ? '.cjs' : '.js'
|
|
19
|
+
const esmExtension = packageJson.type === 'module' ? '.js' : '.mjs'
|
|
20
|
+
|
|
17
21
|
for (const key of ['main', 'module', 'browser', 'types', 'bin', 'types']) {
|
|
18
22
|
if (typeof packageJson[key] === 'string') {
|
|
19
23
|
packageJson[key] = replaceDist(
|
|
20
24
|
packageJson[key],
|
|
21
|
-
key === 'module' ?
|
|
22
|
-
: key === 'main' ?
|
|
23
|
-
: key === 'types' ?
|
|
24
|
-
: outputEsm ?
|
|
25
|
-
:
|
|
25
|
+
key === 'module' ? esmExtension
|
|
26
|
+
: key === 'main' ? cjsExtension
|
|
27
|
+
: key === 'types' ? dtsExtension
|
|
28
|
+
: outputEsm ? esmExtension
|
|
29
|
+
: cjsExtension
|
|
26
30
|
)
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
for (const key of ['bin']) {
|
|
30
34
|
if (typeof packageJson[key] === 'object' && packageJson[key] != null) {
|
|
31
35
|
packageJson[key] = mapValues(packageJson[key], (path) =>
|
|
32
|
-
replaceDist(path, outputEsm ?
|
|
36
|
+
replaceDist(path, outputEsm ? esmExtension : cjsExtension)
|
|
33
37
|
)
|
|
34
38
|
}
|
|
35
39
|
}
|