mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
42 lines
1.5 KiB
JavaScript
42 lines
1.5 KiB
JavaScript
import {defineConfig} from "vite";
|
|
import {createHtmlPlugin} from "vite-plugin-html";
|
|
import {fileURLToPath} from "url";
|
|
import path from "path";
|
|
|
|
const pathName = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig(({mode}) => {
|
|
const APP_VERSION = JSON.stringify(process.env.npm_package_version);
|
|
const PRODUCTION = mode === "production";
|
|
|
|
return {
|
|
base: "/Fantasy-Map-Generator/",
|
|
define: {
|
|
APP_VERSION,
|
|
PRODUCTION
|
|
},
|
|
plugins: [
|
|
createHtmlPlugin({
|
|
inject: {
|
|
data: {
|
|
APP_VERSION: APP_VERSION.replaceAll('"', "")
|
|
}
|
|
}
|
|
})
|
|
],
|
|
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: "scripts", replacement: path.resolve(pathName, "./src/scripts")},
|
|
{find: "utils", replacement: path.resolve(pathName, "./src/utils")}
|
|
]
|
|
}
|
|
};
|
|
});
|