Merge pull request #33776 from element-hq/t3chguy/merge-modules
Absorb element-modules into monorepo
This commit is contained in:
@@ -19,10 +19,15 @@
|
||||
"types": "./lib/element-web-module-api-alpha.d.ts",
|
||||
"import": "./lib/element-web-plugin-engine.js",
|
||||
"require": "./lib/element-web-plugin-engine.umd.cjs"
|
||||
},
|
||||
"./vite.base.ts": {
|
||||
"types": "./vite.base.ts",
|
||||
"import": "./vite.base.ts"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
"lib",
|
||||
"vite.base.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"prepack": "nx build",
|
||||
@@ -36,15 +41,15 @@
|
||||
"@matrix-org/react-sdk-module-api": "^2.5.0",
|
||||
"@microsoft/api-extractor": "^7.49.1",
|
||||
"@types/node": "^22.10.7",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"@types/react": "catalog:",
|
||||
"@types/react-dom": "catalog:",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@vitest/coverage-v8": "catalog:",
|
||||
"matrix-widget-api": "^1.17.0",
|
||||
"rollup-plugin-external-globals": "^0.13.0",
|
||||
"semver": "^7.6.3",
|
||||
"typescript": "^6.0.0",
|
||||
"unplugin-dts": "1.0.1",
|
||||
"typescript": "catalog:",
|
||||
"unplugin-dts": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2026 Element Creations Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base vite config for building Element modules
|
||||
*/
|
||||
|
||||
import { defineConfig, esmExternalRequirePlugin } from "vite";
|
||||
import externalGlobals from "rollup-plugin-external-globals";
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: "lib",
|
||||
target: "esnext",
|
||||
sourcemap: true,
|
||||
rolldownOptions: {
|
||||
plugins: [
|
||||
esmExternalRequirePlugin({
|
||||
external: ["react"],
|
||||
}),
|
||||
],
|
||||
output: {
|
||||
globals: {
|
||||
// Reuse React from the host app
|
||||
react: "window.React",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
externalGlobals({
|
||||
// Reuse React from the host app
|
||||
react: "window.React",
|
||||
}),
|
||||
],
|
||||
define: {
|
||||
// Use production mode for the build as it is tested against production builds of Element Web,
|
||||
// this is required for React JSX versions to be compatible.
|
||||
"process.env.NODE_ENV": "'production'",
|
||||
"process": { env: { NODE_ENV: "production" } },
|
||||
},
|
||||
});
|
||||
@@ -24,7 +24,7 @@
|
||||
"devDependencies": {
|
||||
"@element-hq/element-web-module-api": "workspace:*",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"typescript": "^6.0.0"
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"dependencies": {
|
||||
"@axe-core/playwright": "^4.10.1",
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
"typedoc-plugin-markdown": "^4.9.0",
|
||||
"typedoc-plugin-missing-exports": "^4.1.2",
|
||||
"typescript": "catalog:",
|
||||
"unplugin-dts": "1.0.1",
|
||||
"unplugin-dts": "catalog:",
|
||||
"vite": "catalog:",
|
||||
"vite-plugin-node-polyfills": "^0.28.0",
|
||||
"vitest": "catalog:"
|
||||
|
||||
Reference in New Issue
Block a user