@tamagui/babel-plugin-fully-specified 2.0.0-rc.32 → 2.0.0-rc.33

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/babel-plugin-fully-specified",
3
- "version": "2.0.0-rc.32",
3
+ "version": "2.0.0-rc.33",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",
@@ -62,8 +62,10 @@ function fullySpecifyCommonJS(api, options) {
62
62
  return
63
63
  }
64
64
  }
65
- const filePathWithJs = resolvedPath + jsExtension
66
- if ((0, import_node_fs.existsSync)(filePathWithJs)) {
65
+ if (
66
+ (0, import_node_fs.existsSync)(resolvedPath + jsExtension) ||
67
+ (0, import_node_fs.existsSync)(resolvedPath + cjsExtension)
68
+ ) {
67
69
  ;((newModuleSpecifier += cjsExtension),
68
70
  (arg.value = newModuleSpecifier))
69
71
  return
@@ -34,8 +34,10 @@ function fullySpecifyCommonJS(api, options) {
34
34
  return
35
35
  }
36
36
  }
37
- const filePathWithJs = resolvedPath + jsExtension
38
- if (existsSync(filePathWithJs)) {
37
+ if (
38
+ existsSync(resolvedPath + jsExtension) ||
39
+ existsSync(resolvedPath + cjsExtension)
40
+ ) {
39
41
  ;((newModuleSpecifier += cjsExtension),
40
42
  (arg.value = newModuleSpecifier))
41
43
  return
package/src/commonjs.ts CHANGED
@@ -51,9 +51,11 @@ export default function fullySpecifyCommonJS(
51
51
  }
52
52
  }
53
53
 
54
- // Check if the moduleSpecifier.cjs file exists
55
- const filePathWithJs = resolvedPath + jsExtension
56
- if (existsSync(filePathWithJs)) {
54
+ // Check if source file exists (try .js first, then target extension)
55
+ if (
56
+ existsSync(resolvedPath + jsExtension) ||
57
+ existsSync(resolvedPath + cjsExtension)
58
+ ) {
57
59
  newModuleSpecifier += cjsExtension
58
60
  arg.value = newModuleSpecifier
59
61
  return