Fix loading compound
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
"test": "echo no tests yet"
|
"test": "echo no tests yet"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@arcmantle/vite-plugin-import-css-sheet": "^1.0.12",
|
||||||
"@element-hq/element-web-module-api": "^1.0.0",
|
"@element-hq/element-web-module-api": "^1.0.0",
|
||||||
"@types/node": "^22.10.7",
|
"@types/node": "^22.10.7",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ThemeProvider } from "styled-components";
|
import { ThemeProvider } from "styled-components";
|
||||||
|
import compound from "@vector-im/compound-web/dist/style.css" with { type: "css" };
|
||||||
|
|
||||||
import type { Module, Api, ModuleFactory } from "@element-hq/element-web-module-api";
|
import type { Module, Api, ModuleFactory } from "@element-hq/element-web-module-api";
|
||||||
import Translations from "./translations.json";
|
import Translations from "./translations.json";
|
||||||
@@ -21,6 +22,8 @@ class BannerModule implements Module {
|
|||||||
public constructor(private api: Api) {}
|
public constructor(private api: Api) {}
|
||||||
|
|
||||||
public async load(): Promise<void> {
|
public async load(): Promise<void> {
|
||||||
|
document.adoptedStyleSheets.push(compound);
|
||||||
|
|
||||||
this.api.i18n.register(Translations);
|
this.api.i18n.register(Translations);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/// <reference types="vite-plugin-svgr/client" />
|
/// <reference types="vite-plugin-svgr/client" />
|
||||||
|
/// <reference types="@arcmantle/vite-plugin-import-css-sheet/client" />
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import react from "@vitejs/plugin-react";
|
|||||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
import svgr from "vite-plugin-svgr";
|
import svgr from "vite-plugin-svgr";
|
||||||
|
import { importCSSSheet } from "@arcmantle/vite-plugin-import-css-sheet";
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
@@ -31,6 +32,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
importCSSSheet(),
|
||||||
react(),
|
react(),
|
||||||
svgr(),
|
svgr(),
|
||||||
nodePolyfills({
|
nodePolyfills({
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"test": "echo no tests yet"
|
"test": "echo no tests yet"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@arcmantle/vite-plugin-import-css-sheet": "^1.0.12",
|
||||||
"@element-hq/element-web-module-api": "^1.0.0",
|
"@element-hq/element-web-module-api": "^1.0.0",
|
||||||
"@types/node": "^22.10.7",
|
"@types/node": "^22.10.7",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|||||||
Please see LICENSE files in the repository root for full details.
|
Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import compound from "@vector-im/compound-web/dist/style.css" with { type: "css" };
|
||||||
|
|
||||||
import type { Module, Api, ModuleFactory } from "@element-hq/element-web-module-api";
|
import type { Module, Api, ModuleFactory } from "@element-hq/element-web-module-api";
|
||||||
import Translations from "./translations.json";
|
import Translations from "./translations.json";
|
||||||
import { ModuleConfig, CONFIG_KEY } from "./config";
|
import { ModuleConfig, CONFIG_KEY } from "./config";
|
||||||
@@ -28,6 +30,8 @@ class RestrictedGuestsModule implements Module {
|
|||||||
public constructor(private api: Api) {}
|
public constructor(private api: Api) {}
|
||||||
|
|
||||||
public async load(): Promise<void> {
|
public async load(): Promise<void> {
|
||||||
|
document.adoptedStyleSheets.push(compound);
|
||||||
|
|
||||||
this.api.i18n.register(Translations);
|
this.api.i18n.register(Translations);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2025 New Vector Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
Please see LICENSE files in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// <reference types="vite-plugin-svgr/client" />
|
||||||
|
/// <reference types="@arcmantle/vite-plugin-import-css-sheet/client" />
|
||||||
@@ -11,6 +11,7 @@ import { defineConfig } from "vite";
|
|||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
||||||
import externalGlobals from "rollup-plugin-external-globals";
|
import externalGlobals from "rollup-plugin-external-globals";
|
||||||
|
import { importCSSSheet } from "@arcmantle/vite-plugin-import-css-sheet";
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
importCSSSheet(),
|
||||||
react(),
|
react(),
|
||||||
nodePolyfills({
|
nodePolyfills({
|
||||||
include: ["events"],
|
include: ["events"],
|
||||||
|
|||||||
Reference in New Issue
Block a user