chocola 1.1.10 → 1.1.11

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.
Files changed (2) hide show
  1. package/compiler/index.js +2 -11
  2. package/package.json +1 -1
package/compiler/index.js CHANGED
@@ -2,7 +2,7 @@ import { throwError, genRandomId, incrementAlfabet, isWebLink } from "./utils.js
2
2
  import { JSDOM } from "jsdom";
3
3
  import path from "path";
4
4
  import { promises as fs } from "fs";
5
- import { getComponents, getSrcIndex, processIcons, processStylesheet } from "./pipeline.js";
5
+ import { copyResources, getComponents, getSrcIndex, processIcons, processStylesheet } from "./pipeline.js";
6
6
  import chalk from 'chalk';
7
7
  import beautify from "js-beautify";
8
8
  import { getChocolaConfig } from "../utils.js";
@@ -188,16 +188,7 @@ ${letter}RUNTIME(${letter}, ${JSON.stringify(ctx)});`);
188
188
 
189
189
  await fs.writeFile(path.join(outDirPath, "index.html"), prettyHtml);
190
190
 
191
- const newIndex = await fs.readFile(path.join(outDirPath, "index.html"), "utf8");
192
- const newDoc = new JSDOM(newIndex);
193
- const newElements = Array.from(newDoc.querySelectorAll("*"));
194
-
195
- for (const el of newElements) {
196
- let src = el.getAttribute("src") || el.getAttribute("href");
197
- if (src && !isWebLink(src)) {
198
- await fs.copyFile(path.join(__srcdir, src), path.join(outDirPath, src));
199
- }
200
- }
191
+ await copyResources(__srcdir, outDirPath);
201
192
 
202
193
  console.log(`
203
194
  ▄▄ ▄▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▄ ▄▄ ▄▄ ▄▄▄▄▄ ██
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chocola",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "Chocola pipeline for web apps.",
5
5
  "keywords": [
6
6
  "web",