coralite 0.40.0 → 0.40.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.
@@ -1 +1 @@
1
- {"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,2LAHW,cAAc,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAgXrC;;oCAvXS,mBAAmB;sCAAnB,mBAAmB"}
1
+ {"version":3,"file":"coralite.d.ts","sourceRoot":"","sources":["../../lib/coralite.js"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,2LAHW,cAAc,GACZ,OAAO,CAAC,gBAAgB,CAAC,CA4YrC;;oCAnZS,mBAAmB;sCAAnB,mBAAmB"}
package/dist/lib/index.js CHANGED
@@ -6566,6 +6566,7 @@ async function createCoralite({
6566
6566
  path: path2,
6567
6567
  output: output ? normalize(output) : void 0
6568
6568
  };
6569
+ const trackedOutputFiles = /* @__PURE__ */ new Set();
6569
6570
  const app = {
6570
6571
  options: normalizedOptions,
6571
6572
  pages: null,
@@ -6573,6 +6574,22 @@ async function createCoralite({
6573
6574
  build: null,
6574
6575
  save: null,
6575
6576
  transform: transformNode,
6577
+ trackOutputFile(path3) {
6578
+ trackedOutputFiles.add(normalize(path3));
6579
+ },
6580
+ getTrackedOutputFiles() {
6581
+ return Array.from(trackedOutputFiles);
6582
+ },
6583
+ async writeFile(dest, content, writeOptions = {}) {
6584
+ if (!app.options.output) {
6585
+ throw new Error('app.writeFile requires "output" to be configured');
6586
+ }
6587
+ const fullPath = join5(app.options.output, dest);
6588
+ await mkdir3(dirname7(fullPath), { recursive: true });
6589
+ await writeFile2(fullPath, content, writeOptions);
6590
+ app.trackOutputFile(fullPath);
6591
+ return fullPath;
6592
+ },
6576
6593
  addRenderQueue: null,
6577
6594
  getPagePathsUsingCustomElement: null,
6578
6595
  createComponentElement: null,
@@ -6767,6 +6784,14 @@ async function createCoralite({
6767
6784
  if (assets) {
6768
6785
  app.options.plugins.unshift(staticAssetPlugin(assets));
6769
6786
  }
6787
+ if (externalStyles && output) {
6788
+ for (let i = 0; i < externalStyles.length; i++) {
6789
+ const style = externalStyles[i];
6790
+ if (style.startsWith("/")) {
6791
+ app.trackOutputFile(join5(output, style));
6792
+ }
6793
+ }
6794
+ }
6770
6795
  await Promise.all([
6771
6796
  initHasher(),
6772
6797
  setupPlugins({