Skip to content

Commit

Permalink
Attempt to fix build problem on Windows (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Dec 2, 2024
1 parent 142d349 commit 95960c0
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from "vite";
import dtsPlugin from "vite-plugin-dts";
import { isAbsolute } from "node:path";

export default defineConfig({
plugins: [
Expand All @@ -14,7 +15,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/")
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !isAbsolute(id)
}
}
});
3 changes: 2 additions & 1 deletion frontend/vite-lib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import dtsPlugin from "vite-plugin-dts";
import vuePlugin from "@vitejs/plugin-vue";
import tsconfigPaths from "vite-tsconfig-paths";
import definePlugin from "./vite-define";
import { isAbsolute } from "node:path";

export default defineConfig(({ mode }) => ({
plugins: [
Expand All @@ -24,7 +25,7 @@ export default defineConfig(({ mode }) => ({
formats: ['es']
},
rollupOptions: {
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/")
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !isAbsolute(id)
}
}
}));
3 changes: 2 additions & 1 deletion integration-tests/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "vite";
import dtsPlugin from "vite-plugin-dts";
import tsconfigPaths from "vite-tsconfig-paths";
import { isAbsolute } from "node:path";

export default defineConfig({
plugins: [
Expand All @@ -21,7 +22,7 @@ export default defineConfig({
external: (id) => (
!id.startsWith("./")
&& !id.startsWith("../")
&& /* resolved internal modules */ !id.startsWith("/")
&& /* resolved internal modules */ !isAbsolute(id)
&& !["facilmap-types", "facilmap-utils"].includes(id)
)
}
Expand Down
3 changes: 2 additions & 1 deletion leaflet/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import dtsPlugin from "vite-plugin-dts";
import iconsPlugin from "./rollup-icons";
import { appendFile, readFile } from "fs/promises";
import tsconfigPaths from "vite-tsconfig-paths";
import { isAbsolute } from "node:path";

export default defineConfig({
plugins: [
Expand Down Expand Up @@ -34,7 +35,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: (id) => !id.startsWith("./") && !id.startsWith("../") && !id.startsWith("virtual:icons:") && /* resolved internal modules */ !id.startsWith("/")
external: (id) => !id.startsWith("./") && !id.startsWith("../") && !id.startsWith("virtual:icons:") && /* resolved internal modules */ !isAbsolute(id)
}
},
resolve: {
Expand Down
3 changes: 2 additions & 1 deletion server/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from "vite";
import dtsPlugin from "vite-plugin-dts";
import tsconfigPaths from "vite-tsconfig-paths";
import { isAbsolute } from "node:path";

export default defineConfig({
plugins: [
Expand All @@ -21,7 +22,7 @@ export default defineConfig({
external: (id) => (
!id.startsWith("./")
&& !id.startsWith("../")
&& /* resolved internal modules */ !id.startsWith("/")
&& /* resolved internal modules */ !isAbsolute(id)
&& !["facilmap-types", "facilmap-utils"].includes(id)
)
}
Expand Down
3 changes: 2 additions & 1 deletion types/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from "vite";
import dtsPlugin from "vite-plugin-dts";
import { isAbsolute } from "node:path";

export default defineConfig({
plugins: [
Expand All @@ -16,7 +17,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/")
external: (id) => !id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !isAbsolute(id)
}
}
});
3 changes: 2 additions & 1 deletion utils/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { defineConfig } from "vite";
import dtsPlugin from "vite-plugin-dts";
import tsconfigPaths from "vite-tsconfig-paths";
import { isAbsolute } from "node:path";

export default defineConfig({
plugins: [
Expand All @@ -19,7 +20,7 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: (id) => id.includes("/node_modules/") || (!id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !id.startsWith("/"))
external: (id) => id.includes("/node_modules/") || (!id.startsWith("./") && !id.startsWith("../") && /* resolved internal modules */ !isAbsolute(id))
}
},
test: {
Expand Down

0 comments on commit 95960c0

Please sign in to comment.