@embeddable.com/sdk-react 3.0.0 → 3.0.2-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.
package/lib/index.js CHANGED
@@ -56,9 +56,17 @@ const loadComponentMeta = async (moduleId, ast) => {
56
56
  .replace(".emb.", ".emb-temp.")
57
57
  .replace(/\.ts$/, ".js");
58
58
  await fs__namespace.writeFile(tempFilePath, astring.generate(ast));
59
- const module = await import(url__namespace.pathToFileURL(tempFilePath).href + `?${Date.now()}`);
60
- await fs__namespace.rm(tempFilePath);
61
- return module.meta;
59
+ try {
60
+ const module = await import(url__namespace.pathToFileURL(tempFilePath).href + `?${Date.now()}`);
61
+ return module.meta;
62
+ }
63
+ catch (e) {
64
+ console.error(e);
65
+ return {};
66
+ }
67
+ finally {
68
+ await fs__namespace.rm(tempFilePath);
69
+ }
62
70
  };
63
71
 
64
72
  /**
@@ -1086,6 +1094,7 @@ async function runViteBuild(ctx, watch = null) {
1086
1094
  build: {
1087
1095
  sourcemap: true,
1088
1096
  watch,
1097
+ minify: !watch,
1089
1098
  lib: {
1090
1099
  entry: path__namespace.resolve(ctx.client.rootDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename),
1091
1100
  formats: ["es"],