diff --git a/packages/markup/vite.config.ts b/packages/markup/vite.config.ts index 6ebee2197..1f46b6589 100644 --- a/packages/markup/vite.config.ts +++ b/packages/markup/vite.config.ts @@ -10,7 +10,18 @@ import { viteStaticCopy } from "vite-plugin-static-copy" export default defineConfig({ plugins: [ - vanillaExtractPlugin(), + vanillaExtractPlugin({ + emitCssInSsr: true, + identifiers: ({ hash, filePath, debugId }) => { + const name = filePath + .split("/") + ?.pop() + ?.split(".")[0] + ?.replace("-", "_") + const id = debugId ? "_" + debugId : "" + return `ory_elements__${name}${id}__${hash}` + }, + }), dts({ insertTypesEntry: true }), react(), viteStaticCopy({ diff --git a/packages/preact/vite.config.ts b/packages/preact/vite.config.ts index 5af9556ba..9edbc8107 100644 --- a/packages/preact/vite.config.ts +++ b/packages/preact/vite.config.ts @@ -32,7 +32,18 @@ export default defineConfig({ }, }, plugins: [ - vanillaExtractPlugin(), + vanillaExtractPlugin({ + emitCssInSsr: true, + identifiers: ({ hash, filePath, debugId }) => { + const name = filePath + .split("/") + ?.pop() + ?.split(".")[0] + ?.replace("-", "_") + const id = debugId ? "_" + debugId : "" + return `ory_elements__${name}${id}__${hash}` + }, + }), dts({ insertTypesEntry: true }), preact(), viteStaticCopy({ diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index d026cecfe..aa3eba5fe 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -21,6 +21,15 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, + identifiers: ({ hash, filePath, debugId }) => { + const name = filePath + .split("/") + ?.pop() + ?.split(".")[0] + ?.replace("-", "_") + const id = debugId ? "_" + debugId : "" + return `ory_elements__${name}${id}__${hash}` + }, }), dts({ insertTypesEntry: true,