kopia lustrzana https://github.com/FacilMap/facilmap
Fix build
rodzic
973878593c
commit
ad1901f8a0
|
@ -2,6 +2,7 @@ node_modules
|
|||
*/node_modules
|
||||
*/dist
|
||||
*/out
|
||||
*/out.node
|
||||
docs
|
||||
.github
|
||||
Dockerfile
|
|
@ -0,0 +1,14 @@
|
|||
import { InlineConfig, ViteDevServer } from "vite";
|
||||
|
||||
export const paths: {
|
||||
root: string;
|
||||
dist: string;
|
||||
base: string;
|
||||
mapEntry: string;
|
||||
mapEjs: string;
|
||||
tableEntry: string;
|
||||
tableEjs: string;
|
||||
manifest: string;
|
||||
};
|
||||
|
||||
export function serve(inlineConfig?: InlineConfig): Promise<ViteDevServer>;
|
|
@ -0,0 +1,24 @@
|
|||
import { createServer } from "vite";
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const root = dirname(fileURLToPath(import.meta.url));
|
||||
const dist = `${root}/dist/app`;
|
||||
|
||||
export const paths = {
|
||||
root,
|
||||
dist,
|
||||
base: '/_app/',
|
||||
mapEntry: "src/map/map.ts",
|
||||
mapEjs: `${root}/src/map/map.ejs`,
|
||||
tableEntry: "src/table/table.ts",
|
||||
tableEjs: `${root}/src/table/table.ejs`,
|
||||
manifest: `${dist}/manifest.json`,
|
||||
};
|
||||
|
||||
export async function serve(inlineConfig = {}) {
|
||||
return await createServer({
|
||||
root,
|
||||
...inlineConfig
|
||||
});
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
import { createServer, type InlineConfig, type ViteDevServer } from "vite";
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const root = dirname(fileURLToPath(import.meta.url));
|
||||
const dist = `${root}/dist/app`;
|
||||
|
||||
export const paths = {
|
||||
root,
|
||||
dist,
|
||||
base: '/_app/',
|
||||
mapEntry: "src/map/map.ts",
|
||||
mapEjs: `${root}/src/map/map.ejs`,
|
||||
tableEntry: "src/table/table.ts",
|
||||
tableEjs: `${root}/src/table/table.ejs`,
|
||||
manifest: `${dist}/manifest.json`,
|
||||
};
|
||||
|
||||
export async function serve(inlineConfig: InlineConfig = {}): Promise<ViteDevServer> {
|
||||
return await createServer({
|
||||
root,
|
||||
...inlineConfig
|
||||
});
|
||||
}
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"type": "module",
|
||||
"main": "./dist/lib/facilmap-frontend.mjs",
|
||||
"typings": "./dist/lib/facilmap-frontend.d.ts",
|
||||
"types": "./dist/lib/facilmap-frontend.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { Manifest } from "vite";
|
||||
import { paths, serve } from "facilmap-frontend/build";
|
||||
import { paths, serve } from "facilmap-frontend/build.js";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import type { ID, Line, Marker, PadData, Type } from "facilmap-types";
|
||||
import * as ejs from "ejs";
|
||||
|
|
|
@ -22,7 +22,7 @@ export default defineConfig({
|
|||
!id.startsWith("./")
|
||||
&& !id.startsWith("../")
|
||||
&& /* resolved internal modules */ !id.startsWith("/")
|
||||
&& !id.startsWith("facilmap-")
|
||||
&& !["facilmap-types", "facilmap-utils"].includes(id)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue