@embeddable.com/sdk-core 3.2.0 → 3.2.1
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 +15 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +15 -9
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/buildTypes.ts +7 -5
- package/src/generate.ts +9 -4
package/lib/index.esm.js
CHANGED
|
@@ -385,6 +385,7 @@ async function generate$1(ctx) {
|
|
|
385
385
|
await fs$1.writeFile(path$1.resolve(ctx.client.rootDir, ctx.outputOptions.typesEntryPointFilename), typeImports);
|
|
386
386
|
}
|
|
387
387
|
async function build$1(ctx) {
|
|
388
|
+
var _a;
|
|
388
389
|
await vite.build({
|
|
389
390
|
logLevel: "error",
|
|
390
391
|
build: {
|
|
@@ -394,11 +395,13 @@ async function build$1(ctx) {
|
|
|
394
395
|
formats: ["es"],
|
|
395
396
|
fileName: "embeddable-types",
|
|
396
397
|
},
|
|
397
|
-
rollupOptions:
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
rollupOptions: ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)
|
|
399
|
+
? undefined
|
|
400
|
+
: {
|
|
401
|
+
output: {
|
|
402
|
+
entryFileNames: "embeddable-types-[hash].js",
|
|
403
|
+
},
|
|
400
404
|
},
|
|
401
|
-
},
|
|
402
405
|
outDir: ctx.client.buildDir,
|
|
403
406
|
},
|
|
404
407
|
});
|
|
@@ -450,7 +453,7 @@ async function injectBundleRender(ctx, pluginName) {
|
|
|
450
453
|
await fs$1.writeFile(path$1.resolve(ctx.client.componentDir, "component.tsx"), content.replace(RENDER_IMPORT_TOKEN, importStr));
|
|
451
454
|
}
|
|
452
455
|
async function runStencil(ctx) {
|
|
453
|
-
var _a, _b;
|
|
456
|
+
var _a, _b, _c;
|
|
454
457
|
const logger = ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.logger) || createNodeLogger({ process });
|
|
455
458
|
const sys = ((_b = ctx.dev) === null || _b === void 0 ? void 0 : _b.sys) || createNodeSys({ process });
|
|
456
459
|
const devMode = !!ctx.dev;
|
|
@@ -477,10 +480,13 @@ async function runStencil(ctx) {
|
|
|
477
480
|
const compiler = await createCompiler(validated.config);
|
|
478
481
|
await compiler.build();
|
|
479
482
|
const entryFilePath = path$1.resolve(ctx.client.stencilBuild, "embeddable-wrapper.esm.js");
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
483
|
+
let fileName = "embeddable-wrapper.esm.js";
|
|
484
|
+
if (!((_c = ctx.dev) === null || _c === void 0 ? void 0 : _c.watch)) {
|
|
485
|
+
const entryFileContent = await fs$1.readFile(entryFilePath, "utf8");
|
|
486
|
+
const fileHash = getContentHash(entryFileContent);
|
|
487
|
+
fileName = `embeddable-wrapper.esm-${fileHash}.js`;
|
|
488
|
+
}
|
|
489
|
+
await fs$1.rename(entryFilePath, path$1.resolve(ctx.client.stencilBuild, fileName));
|
|
484
490
|
await compiler.destroy();
|
|
485
491
|
process.chdir(ctx.client.rootDir);
|
|
486
492
|
}
|