@embeddable.com/sdk-core 4.1.11 → 4.1.12-next.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.
@@ -150,7 +150,27 @@ export const resolve = async (specifier, context, nextResolve) => {
150
150
  (context.parentURL?.includes("/node_modules/") || isPackageImport) &&
151
151
  !isTS
152
152
  ) {
153
- return nextResolve(specifier);
153
+ try {
154
+ return await nextResolve(specifier);
155
+ } catch (err) {
156
+ if (
157
+ !path.extname(specifier) &&
158
+ (err.code === "ERR_MODULE_NOT_FOUND" ||
159
+ err.code === "ERR_UNSUPPORTED_DIR_IMPORT")
160
+ ) {
161
+ try {
162
+ return await nextResolve(specifier + ".js");
163
+ } catch {
164
+ // fall through
165
+ }
166
+ try {
167
+ return await nextResolve(specifier + "/index.js");
168
+ } catch {
169
+ // fall through
170
+ }
171
+ }
172
+ throw err;
173
+ }
154
174
  }
155
175
 
156
176
  const isFileUrl = specifier.startsWith("file://");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddable.com/sdk-core",
3
- "version": "4.1.11",
3
+ "version": "4.1.12-next.0",
4
4
  "description": "Core Embeddable SDK module responsible for web-components bundling and publishing.",
5
5
  "keywords": [
6
6
  "embeddable",