feat: declare exports in package.json (#306)
It lets use `moduleResolution=bundler` in TypeScript applications. In particular, it lets use it with Storybook and ts-example in this repository.development
parent
a68c94e892
commit
5ddc8f5af2
|
@ -25084,9 +25084,23 @@
|
|||
"name": "@maxgraph/ts-example-built-with-vite",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"typescript": "~5.3.3",
|
||||
"vite": "~4.4.12"
|
||||
}
|
||||
},
|
||||
"packages/ts-example/node_modules/typescript": {
|
||||
"version": "5.3.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"packages/ts-example/node_modules/vite": {
|
||||
"version": "4.4.11",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz",
|
||||
|
|
|
@ -13,6 +13,17 @@
|
|||
],
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"./css/*": "./css/*",
|
||||
"./images/*": "./images/*",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"css",
|
||||
"dist",
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
|
||||
/* Bundler mode */
|
||||
"allowJs": true,
|
||||
// TODO restore bundler - require exports in the package.json of @maxgraph/core
|
||||
"moduleResolution": "Node",
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
|
|
|
@ -2,12 +2,14 @@
|
|||
"name": "@maxgraph/ts-example-built-with-vite",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc --version && tsc && vite build --base ./",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~5.3.3",
|
||||
"vite": "~4.4.12"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"compilerOptions": {
|
||||
"useDefineForClassFields": true,
|
||||
"sourceMap": true,
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"noEmit": true,
|
||||
"noUnusedLocals": true,
|
||||
|
|
Loading…
Reference in New Issue