@netlify/zip-it-and-ship-it 9.10.0 → 9.11.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.
@@ -21,8 +21,14 @@ const getModuleFormat = async (srcDir, featureFlags, extension, configVersion) =
21
21
  };
22
22
  }
23
23
  if (featureFlags.zisi_pure_esm) {
24
- const packageJsonFile = await getClosestPackageJson(srcDir);
25
24
  const nodeSupport = getNodeSupportMatrix(configVersion);
25
+ if (extension.includes('ts') && nodeSupport.esm) {
26
+ return {
27
+ includedFiles: [],
28
+ moduleFormat: MODULE_FORMAT.ESM,
29
+ };
30
+ }
31
+ const packageJsonFile = await getClosestPackageJson(srcDir);
26
32
  if (packageJsonFile?.contents.type === 'module' && nodeSupport.esm) {
27
33
  return {
28
34
  includedFiles: [packageJsonFile.path],
@@ -31,7 +31,13 @@ const ESBUILD_EXTENSIONS = new Set(['.mjs', '.ts', '.tsx', '.cts', '.mts']);
31
31
  // We use ZISI as the default bundler, except for certain extensions, for which
32
32
  // esbuild is the only option.
33
33
  const getDefaultBundler = async ({ extension, featureFlags, mainFile, runtimeAPIVersion, }) => {
34
- if ((extension === MODULE_FILE_EXTENSION.MJS && featureFlags.zisi_pure_esm_mjs) || runtimeAPIVersion === 2) {
34
+ if (runtimeAPIVersion === 2) {
35
+ if (ESBUILD_EXTENSIONS.has(extension)) {
36
+ return NODE_BUNDLER.ESBUILD;
37
+ }
38
+ return NODE_BUNDLER.NFT;
39
+ }
40
+ if (extension === MODULE_FILE_EXTENSION.MJS && featureFlags.zisi_pure_esm_mjs) {
35
41
  return NODE_BUNDLER.NFT;
36
42
  }
37
43
  if (ESBUILD_EXTENSIONS.has(extension)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/zip-it-and-ship-it",
3
- "version": "9.10.0",
3
+ "version": "9.11.0",
4
4
  "description": "Zip it and ship it",
5
5
  "main": "./dist/main.js",
6
6
  "type": "module",