add build serve and start on other things
All checks were successful
Code quality checks / biome (push) Successful in 7s
All checks were successful
Code quality checks / biome (push) Successful in 7s
This commit is contained in:
parent
d1b1d0aeb5
commit
2552d305da
22 changed files with 281 additions and 74 deletions
15
src/index.ts
15
src/index.ts
|
@ -1,16 +1,27 @@
|
|||
import { resolve } from "node:path";
|
||||
import { environment, verifyRequiredVariables } from "@config";
|
||||
import { logger } from "@creations.works/logger";
|
||||
import { createServer } from "vite";
|
||||
import { type PluginOption, createServer } from "vite";
|
||||
import solidPlugin from "vite-plugin-solid";
|
||||
import tsconfigPaths from "vite-tsconfig-paths";
|
||||
|
||||
verifyRequiredVariables();
|
||||
|
||||
function injectEnvPlugin(): PluginOption {
|
||||
return {
|
||||
name: "inject-env",
|
||||
transformIndexHtml(html) {
|
||||
return html
|
||||
.replace("__FQDN__", environment.fqdn)
|
||||
.replace("__BACKEND_URL__", environment.backendUrl);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const server = await createServer({
|
||||
root: resolve("src"),
|
||||
publicDir: resolve("src/public"),
|
||||
plugins: [solidPlugin(), tsconfigPaths()],
|
||||
plugins: [solidPlugin(), tsconfigPaths(), injectEnvPlugin()],
|
||||
server: {
|
||||
port: environment.port,
|
||||
host: environment.host,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue