Skip to content

Commit 7549992

Browse files
authored
chore/MIG-6918 Bundle as cjs to support react17 (#56)
* bundle as cjs * rename
1 parent 937febe commit 7549992

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed
File renamed without changes.

package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@
33
"description": "Diagram canvas for data modelling capabilities in MongoDB",
44
"version": "0.0.0",
55
"license": "MIT",
6-
"main": "dist/modelling.es.js",
6+
"main": "dist/modelling.cjs.js",
7+
"module": "dist/modelling.es.js",
8+
"exports": {
9+
".": {
10+
"import": {
11+
"types": "./dist/index.d.ts",
12+
"default": "./dist/modelling.es.js"
13+
},
14+
"require": {
15+
"types": "./dist/index.d.ts",
16+
"default": "./dist/modelling.cjs.js"
17+
}
18+
}
19+
},
720
"types": "dist/index.d.ts",
8-
"type": "module",
921
"author": {
1022
"name": "MongoDB Inc",
1123
"email": "[email protected]"

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineConfig({
1212
lib: {
1313
entry: 'src/index.ts',
1414
fileName: format => `modelling.${format}.js`,
15-
formats: ['es'],
15+
formats: ['es', 'cjs'],
1616
},
1717
rollupOptions: {
1818
external: ['react', 'react/jsx-runtime', 'react-dom', /@leafygreen-ui\/*/, '@emotion/react'],

0 commit comments

Comments
 (0)