@embeddable.com/sdk-react 3.0.1 → 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.esm.js +12 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +12 -3
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -31,9 +31,17 @@ const loadComponentMeta = async (moduleId, ast) => {
|
|
|
31
31
|
.replace(".emb.", ".emb-temp.")
|
|
32
32
|
.replace(/\.ts$/, ".js");
|
|
33
33
|
await fs.writeFile(tempFilePath, generate$1(ast));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
try {
|
|
35
|
+
const module = await import(url.pathToFileURL(tempFilePath).href + `?${Date.now()}`);
|
|
36
|
+
return module.meta;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
console.error(e);
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
await fs.rm(tempFilePath);
|
|
44
|
+
}
|
|
37
45
|
};
|
|
38
46
|
|
|
39
47
|
/**
|
|
@@ -1061,6 +1069,7 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1061
1069
|
build: {
|
|
1062
1070
|
sourcemap: true,
|
|
1063
1071
|
watch,
|
|
1072
|
+
minify: !watch,
|
|
1064
1073
|
lib: {
|
|
1065
1074
|
entry: path.resolve(ctx.client.rootDir, ctx["sdk-react"].outputOptions.componentsEntryPointFilename),
|
|
1066
1075
|
formats: ["es"],
|