Update build config so imports work as expected

This commit is contained in:
2026-03-11 22:52:46 -04:00
parent 0de206016a
commit ca342cc238
4 changed files with 7 additions and 5 deletions

View File

@@ -1,2 +1 @@
export { default as ThemeProvider, useTheme } from "$/providers/theme/ThemeProvider";

View File

@@ -6,6 +6,6 @@ export * from "$/component/modal";
export * from "$/component/nav";
export * from "$/component/progress";
export * from "$/component/tab";
export * from "$/component/theme";
export * from "$/component/toaster";
export * from "$/providers/theme/theme";

View File

@@ -69,7 +69,6 @@
"type": "git",
"url": "git+https://git.mattrixwv.com/BaseLibraries/MattrixwvReactComponents.git"
},
"main": "./dist/mattrixwv-components.cjs",
"module": "./dist/mattrixwv-components.js",
"types": "./dist/mattrixwv-components.d.ts",
"exports": {
@@ -109,6 +108,10 @@
"types": "./dist/tab.d.ts",
"import": "./dist/tab.js"
},
"./theme": {
"types": "./dist/theme.d.ts",
"import": "./dist/theme.js"
},
"./toaster": {
"types": "./dist/toaster.d.ts",
"import": "./dist/toaster.js"

View File

@@ -10,7 +10,7 @@ import { viteStaticCopy } from "vite-plugin-static-copy";
import { peerDependencies } from "./package.json";
const modules = [ "button", "input", "loading", "message", "modal", "nav", "progress", "tab", "toaster" ];
const modules = [ "button", "input", "loading", "message", "modal", "nav", "progress", "tab", "theme", "toaster" ];
// https://vite.dev/config/
@@ -51,7 +51,7 @@ export default defineConfig({
build: {
lib: {
entry: {
index: resolve(__dirname, "lib/index.ts"),
"mattrixwv-components": resolve(__dirname, "lib/index.ts"),
...Object.fromEntries(modules.map(mod => [mod, resolve(__dirname, `lib/component/${mod}/index.ts`)]))
},
formats: [ "es" ],