Skip to content

Commit 1caadb9

Browse files
committed
🚑
1 parent 84dabd7 commit 1caadb9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

plaoc/cli/helper/generator.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,17 @@ export class BundleZipGenerator {
162162
path: `usr/www`,
163163
},
164164
];
165-
const addFile_DistToUsr = (filepath: string, alias: string = filepath) => {
165+
const addFile_DistToUsr = async (
166+
filepath: string,
167+
alias: string = filepath
168+
) => {
166169
const path = import.meta.resolve(`../serve/${filepath}`);
167170
let data = null;
168171
// 如果是远程的
169172
if (path.startsWith("http")) {
170-
data = fs.readFileSync(import.meta.resolve(`../serve/${filepath}`));
173+
data = await (await fetch(path)).text();
171174
} else {
172-
data = fs.readFileSync(
173-
fileURLToPath(import.meta.resolve(`../serve/${filepath}`))
174-
);
175+
data = fs.readFileSync(fileURLToPath(path));
175176
}
176177
entries.push({
177178
dir: false,

0 commit comments

Comments
 (0)