Skip to content

Commit 84dabd7

Browse files
committed
🚑
1 parent daf0e36 commit 84dabd7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

plaoc/cli/helper/generator.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,20 @@ export class BundleZipGenerator {
163163
},
164164
];
165165
const addFile_DistToUsr = (filepath: string, alias: string = filepath) => {
166-
console.log(import.meta.resolve(`../serve/${filepath}`));
166+
const path = import.meta.resolve(`../serve/${filepath}`);
167+
let data = null;
168+
// 如果是远程的
169+
if (path.startsWith("http")) {
170+
data = fs.readFileSync(import.meta.resolve(`../serve/${filepath}`));
171+
} else {
172+
data = fs.readFileSync(
173+
fileURLToPath(import.meta.resolve(`../serve/${filepath}`))
174+
);
175+
}
167176
entries.push({
168177
dir: false,
169178
path: `usr/${alias}`,
170-
data: fs.readFileSync(
171-
fileURLToPath(import.meta.resolve(`../serve/${filepath}`))
172-
),
179+
data: data,
173180
});
174181
};
175182
if (dev) {

0 commit comments

Comments
 (0)