zapier-platform-cli 17.0.3 → 17.0.4
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/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/utils/build.js +13 -1
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
package/src/utils/build.js
CHANGED
|
@@ -53,6 +53,17 @@ const requiredFiles = async ({ cwd, entryPoints }) => {
|
|
|
53
53
|
cwd += path.sep;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
const appPackageJson = require(path.join(cwd, 'package.json'));
|
|
57
|
+
const isESM = appPackageJson.type === 'module';
|
|
58
|
+
// Only include 'module' condition if the app is an ESM app (PDE-6187)
|
|
59
|
+
// otherwise exclude 'module' since it breaks the build for hybrid packages (like uuid)
|
|
60
|
+
// in CJS apps by only including ESM version of packages.
|
|
61
|
+
// An empty list is necessary because otherwise if `platform: node` is specified,
|
|
62
|
+
// the 'module' condition is included by default.
|
|
63
|
+
// https://esbuild.github.io/api/#conditions
|
|
64
|
+
const conditions = isESM ? ['module'] : [];
|
|
65
|
+
const format = isESM ? 'esm' : 'cjs';
|
|
66
|
+
|
|
56
67
|
const result = await esbuild.build({
|
|
57
68
|
entryPoints,
|
|
58
69
|
outdir: './build',
|
|
@@ -61,7 +72,8 @@ const requiredFiles = async ({ cwd, entryPoints }) => {
|
|
|
61
72
|
metafile: true,
|
|
62
73
|
logLevel: 'warning',
|
|
63
74
|
external: ['../test/userapp'],
|
|
64
|
-
format
|
|
75
|
+
format,
|
|
76
|
+
conditions,
|
|
65
77
|
write: false, // no need to write outfile
|
|
66
78
|
absWorkingDir: cwd,
|
|
67
79
|
tsconfigRaw: '{}',
|