@embeddable.com/sdk-react 3.2.2 → 3.3.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/lib/index.esm.js CHANGED
@@ -1112,7 +1112,7 @@ async function runViteBuild(ctx, watch = null) {
1112
1112
  }
1113
1113
  : undefined,
1114
1114
  lib: {
1115
- entry: path.resolve(ctx.client.rootDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename),
1115
+ entry: path.resolve(ctx.client.buildDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename),
1116
1116
  formats: ["es"],
1117
1117
  fileName: ctx["sdk-react"].outputOptions.fileName,
1118
1118
  },
@@ -1139,7 +1139,7 @@ const ADDITIONAL_CONTENT_IMPORT_TOKEN = "{{ADDITIONAL_CONTENT_IMPORT}}";
1139
1139
  const ADDITIONAL_CONTENT_BEGIN_TOKEN = "{{ADDITIONAL_CONTENT_BEGIN}}";
1140
1140
  const ADDITIONAL_CONTENT_END_TOKEN = "{{ADDITIONAL_CONTENT_END}}";
1141
1141
  function getRelativeFileNameForImport(ctx, fileName) {
1142
- return `./${path
1142
+ return `../${path
1143
1143
  .relative(ctx.client.rootDir, fileName)
1144
1144
  // it is a bit of a hack. On windows the path will look like '.src\something\something'
1145
1145
  // but for imports it must be '.src/something/something'
@@ -1166,7 +1166,7 @@ async function prepareEntrypoint(ctx, filesList) {
1166
1166
  }
1167
1167
  }
1168
1168
  const content = await fs$2.readFile(path.resolve(ctx["sdk-react"].templatesDir, `${ctx["sdk-react"].outputOptions.componentsEntryPointFilename}.template`), "utf8");
1169
- await fs$2.writeFile(path.resolve(ctx.client.rootDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename), content
1169
+ await fs$2.writeFile(path.resolve(ctx.client.buildDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename), content
1170
1170
  .replace(IMPORT_REPLACE_TOKEN, imports)
1171
1171
  .replace(ERROR_FALLBACK_COMPONENT_IMPORT_TOKEN, errorBoundaryImport)
1172
1172
  .replace(ERROR_FALLBACK_COMPONENT_TOKEN, errorFallbackComponent)
@@ -1181,7 +1181,7 @@ var build = async (ctx) => {
1181
1181
  };
1182
1182
 
1183
1183
  var cleanup = async (ctx) => {
1184
- await rm(resolve(ctx.client.rootDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename));
1184
+ await rm(resolve(ctx.client.buildDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename));
1185
1185
  };
1186
1186
 
1187
1187
  var index = () => {