Skip to content

Commit caecdb9

Browse files
committed
Merge branch 'develop-patch' into develop-minor
2 parents c38fc7d + 0d5c631 commit caecdb9

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

panel/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "kirby",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"build": "vite build",
67
"build:docs": "node scripts/docs.mjs",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-env node */
22
import fs from "fs";
3-
import generateDocs from "./docs.mjs";
3+
import generateDocs from "./docs";
44

55
/**
66
* Runs callback on any kind of console exit
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { defineConfig, loadEnv } from "vite";
55
import { minify } from "terser";
66
import vue from "@vitejs/plugin-vue2";
77
import { viteStaticCopy } from "vite-plugin-static-copy";
8-
import kirby from "./scripts/vite-kirby.mjs";
8+
import kirby from "./scripts/vite-kirby";
99
import postcssLightDarkFunction from "@csstools/postcss-light-dark-function";
1010

1111
/**
@@ -28,7 +28,7 @@ function createAliases(proxy) {
2828
/**
2929
* Returns the server configuration
3030
*/
31-
function createServer(proxy) {
31+
async function createServer(proxy) {
3232
return {
3333
allowedHosts: [proxy.target.substring(8)],
3434
cors: { origin: proxy.target },
@@ -39,16 +39,17 @@ function createServer(proxy) {
3939
},
4040
open: proxy.target + "/panel",
4141
port: 3000,
42-
...createCustomServer()
42+
...(await createCustomServer())
4343
};
4444
}
4545

4646
/**
4747
* Returns custom server configuration, if it exists
4848
*/
49-
function createCustomServer() {
49+
async function createCustomServer() {
5050
try {
51-
return require("./vite.config.custom.js");
51+
const module = await import("./vite.config.custom.js");
52+
return module.default ?? {};
5253
} catch {
5354
return {};
5455
}
@@ -114,7 +115,7 @@ function createTest() {
114115
/**
115116
* Returns the Vite configuration
116117
*/
117-
export default defineConfig(({ mode }) => {
118+
export default defineConfig(async ({ mode }) => {
118119
// Load env file based on `mode` in the current working directory.
119120
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
120121
process.env = {
@@ -168,7 +169,7 @@ export default defineConfig(({ mode }) => {
168169
resolve: {
169170
alias: createAliases(proxy)
170171
},
171-
server: createServer(proxy),
172+
server: await createServer(proxy),
172173
test: createTest()
173174
};
174175
});

0 commit comments

Comments
 (0)