@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.js
CHANGED
|
@@ -411,13 +411,19 @@ var extractComponentsConfigPlugin = ({ globalKey, outputDir, fileName, component
|
|
|
411
411
|
var _a;
|
|
412
412
|
if (componentFileRegex.test(moduleInfo.id) &&
|
|
413
413
|
((_a = moduleInfo.code) === null || _a === void 0 ? void 0 : _a.includes(searchEntry))) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
value
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
414
|
+
try {
|
|
415
|
+
const meta = await loadComponentMeta(moduleInfo.id);
|
|
416
|
+
const configJSON = JSON.stringify(meta, (_key, value) => typeof value === "object" &&
|
|
417
|
+
value !== null &&
|
|
418
|
+
"__embeddableType" in value
|
|
419
|
+
? value.toString()
|
|
420
|
+
: value);
|
|
421
|
+
configs.push(configJSON);
|
|
422
|
+
}
|
|
423
|
+
catch (error) {
|
|
424
|
+
console.log("Error parsing component meta: ", moduleInfo.id);
|
|
425
|
+
console.error(error);
|
|
426
|
+
}
|
|
421
427
|
}
|
|
422
428
|
},
|
|
423
429
|
buildEnd: async () => {
|
|
@@ -1080,7 +1086,10 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1080
1086
|
var _a;
|
|
1081
1087
|
return await vite__namespace.build({
|
|
1082
1088
|
logLevel: !!watch ? "info" : "error",
|
|
1083
|
-
resolve:
|
|
1089
|
+
resolve: {
|
|
1090
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".json"],
|
|
1091
|
+
...(_a = ctx.client.viteConfig) === null || _a === void 0 ? void 0 : _a.resolve,
|
|
1092
|
+
},
|
|
1084
1093
|
plugins: [
|
|
1085
1094
|
viteReactPlugin(),
|
|
1086
1095
|
extractComponentsConfigPlugin({
|
|
@@ -1103,10 +1112,16 @@ async function runViteBuild(ctx, watch = null) {
|
|
|
1103
1112
|
],
|
|
1104
1113
|
build: {
|
|
1105
1114
|
sourcemap: true,
|
|
1106
|
-
watch
|
|
1115
|
+
watch: watch
|
|
1116
|
+
? {
|
|
1117
|
+
include: [ctx.client.srcDir + "/**"],
|
|
1118
|
+
exclude: ["**/node_modules/**"],
|
|
1119
|
+
}
|
|
1120
|
+
: undefined,
|
|
1107
1121
|
minify: !watch,
|
|
1108
1122
|
rollupOptions: watch
|
|
1109
1123
|
? {
|
|
1124
|
+
cache: true,
|
|
1110
1125
|
...ctx.client.rollupOptions,
|
|
1111
1126
|
output: {
|
|
1112
1127
|
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
|