chocola 1.1.17 → 1.1.19

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/compiler/index.js CHANGED
@@ -188,7 +188,7 @@ ${letter}RUNTIME(${letter}, ${JSON.stringify(ctx)});`);
188
188
 
189
189
  await fs.writeFile(path.join(outDirPath, "index.html"), prettyHtml);
190
190
 
191
- await copyResources(__srcdir, outDirPath);
191
+ await copyResources(__rootdir, __srcdir, outDirPath);
192
192
 
193
193
  console.log(`
194
194
  ▄▄ ▄▄▄ ▄▄▄▄ ▄▄▄▄ ▄▄▄ ▄▄ ▄▄ ▄▄▄▄▄ ██
@@ -124,19 +124,19 @@ export async function processIcons(link, __rootdir, __srcdir, outDirPath) {
124
124
  }
125
125
  }
126
126
 
127
- export async function copyResources(__srcdir, outDirPath) {
127
+ export async function copyResources(__rootdir, __srcdir, outDirPath) {
128
128
  try {
129
129
  const newIndex = await fs.readFile(path.join(outDirPath, "index.html"), "utf8");
130
130
  const newDoc = new JSDOM(newIndex);
131
131
  const newElements = Array.from(newDoc.window.document.querySelectorAll("*"));
132
132
 
133
133
  for (const el of newElements) {
134
- if (el.hasAttribute("rel")) return;
134
+ if (el.hasAttribute("rel")) continue;
135
135
 
136
136
  const src = el.getAttribute("src") || el.getAttribute("href");
137
137
 
138
138
  if (src && !isWebLink(src)) {
139
- const srcPath = path.join(__srcdir, src);
139
+ const srcPath = path.join(__rootdir, __srcdir, src);
140
140
  const destPath = path.join(outDirPath, src);
141
141
 
142
142
  await fs.mkdir(path.dirname(destPath), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chocola",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "description": "Chocola pipeline for web apps.",
5
5
  "keywords": [
6
6
  "web",