Skip to content

Commit

Permalink
🐛 修复deno编译的css和js文件名第一个字符是'_'引起android资源加载失败
Browse files Browse the repository at this point in the history
  • Loading branch information
jackie-yellow committed May 13, 2024
1 parent 65dc97a commit 7179d84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions scripts/helper/AssetsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ export class AssetsConfig {

const symlink = (target: string, path: string) => {
if (fs.existsSync(path)) {
if (!fs.statSync(path).isSymbolicLink) {
throw new Error(`symbol link fail, ${path} exists.`);
if (!fs.statSync(path).isSymbolicLink()) {
// throw new Error(`symbol link fail, ${path} exists.`);
fs.unlinkSync(path);
} else {
fs.rmSync(path, { recursive: true }); // 删除文件夹以及其内容
}
fs.rmSync(path, { recursive: true }); // 删除文件夹以及其内容
} else {
fs.mkdirSync(node_path.dirname(path), { recursive: true });
}
Expand Down
4 changes: 2 additions & 2 deletions toolkit/dweb-desk-assets/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default defineConfig({
error: path.join(__dirname, "/error.html"),
},
output: {
assetFileNames: `assets/[hash].[ext]`,
chunkFileNames: `[hash].js`,
assetFileNames: `assets/F[name]-[hash].[ext]`,
chunkFileNames: `F[name]-[hash].js`,
},
},
},
Expand Down

0 comments on commit 7179d84

Please sign in to comment.