@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.js CHANGED
@@ -412,6 +412,7 @@ async function generate$1(ctx) {
412
412
  await fs__namespace.writeFile(path__namespace.resolve(ctx.client.rootDir, ctx.outputOptions.typesEntryPointFilename), typeImports);
413
413
  }
414
414
  async function build$1(ctx) {
415
+ var _a;
415
416
  await vite__namespace.build({
416
417
  logLevel: "error",
417
418
  build: {
@@ -421,11 +422,13 @@ async function build$1(ctx) {
421
422
  formats: ["es"],
422
423
  fileName: "embeddable-types",
423
424
  },
424
- rollupOptions: {
425
- output: {
426
- entryFileNames: "embeddable-types-[hash].js",
425
+ rollupOptions: ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)
426
+ ? undefined
427
+ : {
428
+ output: {
429
+ entryFileNames: "embeddable-types-[hash].js",
430
+ },
427
431
  },
428
- },
429
432
  outDir: ctx.client.buildDir,
430
433
  },
431
434
  });
@@ -477,7 +480,7 @@ async function injectBundleRender(ctx, pluginName) {
477
480
  await fs__namespace.writeFile(path__namespace.resolve(ctx.client.componentDir, "component.tsx"), content.replace(RENDER_IMPORT_TOKEN, importStr));
478
481
  }
479
482
  async function runStencil(ctx) {
480
- var _a, _b;
483
+ var _a, _b, _c;
481
484
  const logger = ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.logger) || node.createNodeLogger({ process });
482
485
  const sys = ((_b = ctx.dev) === null || _b === void 0 ? void 0 : _b.sys) || node.createNodeSys({ process });
483
486
  const devMode = !!ctx.dev;
@@ -504,10 +507,13 @@ async function runStencil(ctx) {
504
507
  const compiler$1 = await compiler.createCompiler(validated.config);
505
508
  await compiler$1.build();
506
509
  const entryFilePath = path__namespace.resolve(ctx.client.stencilBuild, "embeddable-wrapper.esm.js");
507
- const entryFileContent = await fs__namespace.readFile(entryFilePath, "utf8");
508
- const fileHash = getContentHash(entryFileContent);
509
- const newFileName = `embeddable-wrapper.esm-${fileHash}.js`;
510
- await fs__namespace.rename(entryFilePath, path__namespace.resolve(ctx.client.stencilBuild, newFileName));
510
+ let fileName = "embeddable-wrapper.esm.js";
511
+ if (!((_c = ctx.dev) === null || _c === void 0 ? void 0 : _c.watch)) {
512
+ const entryFileContent = await fs__namespace.readFile(entryFilePath, "utf8");
513
+ const fileHash = getContentHash(entryFileContent);
514
+ fileName = `embeddable-wrapper.esm-${fileHash}.js`;
515
+ }
516
+ await fs__namespace.rename(entryFilePath, path__namespace.resolve(ctx.client.stencilBuild, fileName));
511
517
  await compiler$1.destroy();
512
518
  process.chdir(ctx.client.rootDir);
513
519
  }