fix: refactor path resolution logic for project root
This commit is contained in:
parent
5994224468
commit
8b8c9b9984
@ -14,10 +14,15 @@ const plugins = [
|
||||
compression({ include: /\.js$/i, deleteOriginalAssets: true }),
|
||||
];
|
||||
|
||||
function getProjectRoot() {
|
||||
const currentFile = new URL(import.meta.url).pathname;
|
||||
return currentFile.substring(0, currentFile.lastIndexOf("/")) + "/";
|
||||
}
|
||||
|
||||
const resolve = {
|
||||
alias: {
|
||||
vue: "vue/dist/vue.esm.js",
|
||||
"@/": fileURLToPath(new URL("./src/", import.meta.url)),
|
||||
"@/": getProjectRoot() + "src/",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user