Skip to content

Commit f33a7b0

Browse files
committed
Fix vite config for the example widget and the dedup of it. Also fix the exports in the package jsons
Signed-off-by: MTRNord <[email protected]>
1 parent fb94ea6 commit f33a7b0

File tree

6 files changed

+48
-23
lines changed

6 files changed

+48
-23
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,8 @@ dist
140140
.yarn/unplugged
141141
.yarn/build-state.yml
142142
.yarn/install-state.gz
143-
.pnp.*
143+
.pnp.*
144+
145+
# Debug Helpers
146+
log.sh
147+
log.out

example-widget-mui/vite.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
Plugin,
2121
PluginOption,
2222
defineConfig,
23-
searchForWorkspaceRoot,
2423
} from 'vite';
2524

2625
const plugins: [Plugin | PluginOption] = [react()];
@@ -45,13 +44,15 @@ export default defineConfig({
4544
'react',
4645
'react-dom',
4746
'@matrix-widget-toolkit/react',
47+
'@matrix-widget-toolkit/mui',
48+
'@matrix-widget-toolkit/api',
4849
'react-redux',
4950
'@mui/material',
5051
],
5152
},
5253
server: {
5354
fs: {
54-
allow: [searchForWorkspaceRoot(process.cwd())],
55+
allow: ['..'],
5556
},
5657
},
5758
plugins,

packages/api/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
"author": "Nordeck IT + Consulting GmbH",
66
"license": "Apache-2.0",
77
"source": "./src/index.ts",
8-
"module": "./src/index.ts",
98
"types": "./src/index.ts",
9+
"exports": {
10+
"import": "./src/index.ts",
11+
"require": "./src/index.ts"
12+
},
1013
"type": "module",
1114
"devDependencies": {
1215
"@rollup/plugin-commonjs": "^26.0.1",
@@ -40,9 +43,11 @@
4043
"directory": "packages/api"
4144
},
4245
"publishConfig": {
43-
"main": "./build/cjs/index.js",
44-
"module": "./build/esm/index.js",
45-
"types": "./build/index.d.ts"
46+
"types": "./build/index.d.ts",
47+
"exports": {
48+
"import": "./build/esm/index.js",
49+
"require": "./build/cjs/index.js"
50+
}
4651
},
4752
"files": [
4853
"build"
@@ -52,4 +57,4 @@
5257
"widget",
5358
"matrix-widget-api"
5459
]
55-
}
60+
}

packages/mui/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
"author": "Nordeck IT + Consulting GmbH",
66
"license": "Apache-2.0",
77
"source": "./src/index.ts",
8-
"module": "./src/index.ts",
98
"types": "./src/index.ts",
9+
"exports": {
10+
"import": "./src/index.ts",
11+
"require": "./src/index.ts"
12+
},
1013
"type": "module",
1114
"devDependencies": {
1215
"@testing-library/jest-dom": "^6.5.0",
@@ -62,9 +65,11 @@
6265
"directory": "packages/mui"
6366
},
6467
"publishConfig": {
65-
"main": "./build/cjs/index.js",
66-
"module": "./build/esm/index.js",
67-
"types": "./build/index.d.ts"
68+
"types": "./build/index.d.ts",
69+
"exports": {
70+
"import": "./build/esm/index.js",
71+
"require": "./build/cjs/index.js"
72+
}
6873
},
6974
"files": [
7075
"build"
@@ -74,4 +79,4 @@
7479
"widget",
7580
"matrix-widget-api"
7681
]
77-
}
82+
}

packages/react/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
"author": "Nordeck IT + Consulting GmbH",
66
"license": "Apache-2.0",
77
"source": "./src/index.ts",
8-
"module": "./src/index.ts",
98
"types": "./src/index.ts",
9+
"exports": {
10+
"import": "./src/index.ts",
11+
"require": "./src/index.ts"
12+
},
1013
"type": "module",
1114
"devDependencies": {
1215
"@testing-library/jest-dom": "^6.5.0",
@@ -44,9 +47,11 @@
4447
"directory": "packages/react"
4548
},
4649
"publishConfig": {
47-
"main": "./build/cjs/index.js",
48-
"module": "./build/esm/index.js",
49-
"types": "./build/index.d.ts"
50+
"types": "./build/index.d.ts",
51+
"exports": {
52+
"import": "./build/esm/index.js",
53+
"require": "./build/cjs/index.js"
54+
}
5055
},
5156
"files": [
5257
"build"
@@ -56,4 +61,4 @@
5661
"widget",
5762
"matrix-widget-api"
5863
]
59-
}
64+
}

packages/testing/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
"author": "Nordeck IT + Consulting GmbH",
66
"license": "Apache-2.0",
77
"source": "./src/index.ts",
8-
"module": "./src/index.ts",
98
"types": "./src/index.ts",
9+
"exports": {
10+
"import": "./src/index.ts",
11+
"require": "./src/index.ts"
12+
},
1013
"type": "module",
1114
"devDependencies": {
1215
"@types/lodash": "^4.17.7",
@@ -40,9 +43,11 @@
4043
"directory": "packages/testing"
4144
},
4245
"publishConfig": {
43-
"main": "./build/cjs/index.js",
44-
"module": "./build/esm/index.js",
45-
"types": "./build/index.d.ts"
46+
"types": "./build/index.d.ts",
47+
"exports": {
48+
"import": "./build/esm/index.js",
49+
"require": "./build/cjs/index.js"
50+
}
4651
},
4752
"files": [
4853
"build"
@@ -52,4 +57,4 @@
5257
"widget",
5358
"matrix-widget-api"
5459
]
55-
}
60+
}

0 commit comments

Comments
 (0)