@embeddable.com/sdk-react 3.7.0 → 3.8.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 +24 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +24 -9
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -385,13 +385,19 @@ var extractComponentsConfigPlugin = ({ globalKey, outputDir, fileName, component
|
|
|
385
385
|
var _a;
|
|
386
386
|
if (componentFileRegex.test(moduleInfo.id) &&
|
|
387
387
|
((_a = moduleInfo.code) === null || _a === void 0 ? void 0 : _a.includes(searchEntry))) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
value
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
388
|
+
try {
|
|
389
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
390
|
+
const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
|
|
391
|
+
value !== null &&
|
|
392
|
+
"__embeddableType" in value
|
|
393
|
+
? value.toString()
|
|
394
|
+
: value);
|
|
395
|
+
configs.push(configJSON);
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
console.log("Error parsing component meta: ", moduleInfo.id);
|
|
399
|
+
console.error(error);
|
|
400
|
+
}
|
|
395
401
|
}
|
|
396
402
|
},
|
|
397
403
|
buildEnd: async () => {
|
|
@@ -1054,7 +1060,10 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1054
1060
|
var _a;
|
|
1055
1061
|
return await vite.build({
|
|
1056
1062
|
logLevel: !!watch ? "info" : "error",
|
|
1057
|
-
resolve:
|
|
1063
|
+
resolve: {
|
|
1064
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
|
|
1065
|
+
...(_a = ctx.client.viteConfig) === null || _a === void 0 ? void 0 : _a.resolve,
|
|
1066
|
+
},
|
|
1058
1067
|
plugins: [
|
|
1059
1068
|
viteReactPlugin(),
|
|
1060
1069
|
extractComponentsConfigPlugin({
|
|
@@ -1077,10 +1086,16 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1077
1086
|
],
|
|
1078
1087
|
build: {
|
|
1079
1088
|
sourcemap: true,
|
|
1080
|
-
watch
|
|
1089
|
+
watch: watch
|
|
1090
|
+
? {
|
|
1091
|
+
include: [ctx.client.srcDir + "/**"],
|
|
1092
|
+
exclude: ["**/node_modules/**"],
|
|
1093
|
+
}
|
|
1094
|
+
: undefined,
|
|
1081
1095
|
minify: !watch,
|
|
1082
1096
|
rollupOptions: watch
|
|
1083
1097
|
? {
|
|
1098
|
+
cache: true,
|
|
1084
1099
|
...ctx.client.rollupOptions,
|
|
1085
1100
|
output: {
|
|
1086
1101
|
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
|