diff --git a/partykit.json b/partykit.json index 0781888..8a0a177 100644 --- a/partykit.json +++ b/partykit.json @@ -10,6 +10,9 @@ "react": "@preact/compat", "react-dom": "@preact/compat" }, + "loaders": { + ".module.css": "local-css" + }, "outdir": "public", "format": "iife", "splitting": false diff --git a/public/cursors.css b/public/cursors.css new file mode 100644 index 0000000..5c39168 --- /dev/null +++ b/public/cursors.css @@ -0,0 +1,5 @@ +/* src/styles.module.css */ +.styles_x { + border: 1px solid red; +} +/*# sourceMappingURL=cursors.css.map */ diff --git a/public/cursors.css.map b/public/cursors.css.map new file mode 100644 index 0000000..a937387 --- /dev/null +++ b/public/cursors.css.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../src/styles.module.css"], + "sourcesContent": [".x {\n border: 1px solid red;\n}\n"], + "mappings": ";AAAA,CAACA;AACC,UAAQ,IAAI,MAAM;AACpB;", + "names": ["x"] +} diff --git a/src/cursors.tsx b/src/cursors.tsx index 18bcfa4..bf616dd 100644 --- a/src/cursors.tsx +++ b/src/cursors.tsx @@ -3,6 +3,19 @@ import { render } from "react-dom"; import PresenceProvider from "./presence/presence-context"; import Cursors from "./presence/Cursors"; +// @ts-ignore +import classes from "./styles.module.css"; + +// declare everything imported from *.module.css to be strings + +// // This doesn't appear to work right now, hence the @ts-ignore up there +// declare module "*.module.css" { +// const classes: { [key: string]: string }; +// export default classes; +// } + +console.log(classes); + declare const PARTYKIT_HOST: string; const pageId = window?.location.href @@ -19,6 +32,7 @@ function App() { color: "#0000f0", }} > +