mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
refactor(es modules): set up aliases
This commit is contained in:
parent
7755d8b588
commit
9206f46c42
4 changed files with 27 additions and 18 deletions
|
|
@ -1,14 +1,22 @@
|
|||
// import {defineConfig} from "vite";
|
||||
// import {fileURLToPath} from "url";
|
||||
// import path from "path";
|
||||
import {defineConfig} from "vite";
|
||||
import {fileURLToPath} from "url";
|
||||
import path from "path";
|
||||
|
||||
// const pathName = path.dirname(fileURLToPath(import.meta.url));
|
||||
const pathName = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// export default defineConfig({
|
||||
// // base: "/Fantasy-Map-Generator/",
|
||||
// resolve: {
|
||||
// alias: [
|
||||
// {find: "@", replacement: path.resolve(pathName, "./src")}
|
||||
// ]
|
||||
// }
|
||||
// });
|
||||
export default defineConfig({
|
||||
base: "/Fantasy-Map-Generator/",
|
||||
resolve: {
|
||||
alias: [
|
||||
{find: "src", replacement: path.resolve(pathName, "./src")},
|
||||
{find: "components", replacement: path.resolve(pathName, "./src/components")},
|
||||
{find: "config", replacement: path.resolve(pathName, "./src/config")},
|
||||
{find: "constants", replacement: path.resolve(pathName, "./src/constants")},
|
||||
{find: "layers", replacement: path.resolve(pathName, "./src/layers")},
|
||||
{find: "libs", replacement: path.resolve(pathName, "./src/libs")},
|
||||
{find: "modules", replacement: path.resolve(pathName, "./src/modules")},
|
||||
{find: "modules", replacement: path.resolve(pathName, "./src/modules")},
|
||||
{find: "utils", replacement: path.resolve(pathName, "./src/utils")}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue