Skip to content

Commit

Permalink
fix: fix building bug
Browse files Browse the repository at this point in the history
  • Loading branch information
itsu-dev committed Oct 16, 2023
1 parent f90e8de commit bc59ff7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sohosai/react-tsukuba-map",
"version": "0.2.1",
"version": "0.2.2",
"type": "module",
"license": "(MIT OR Apache-2.0)",
"scripts": {
Expand All @@ -9,9 +9,10 @@
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"files": ["distES"],
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/types/index.d.ts",
"exports": {
".": {
"require": "./dist/index.umd.cjs",
Expand All @@ -25,9 +26,11 @@
"type": "git",
"url": "git://github.com/@sohosai/react-tsukuba-map.git"
},
"peerDependencies": {
"react": "^18.2.0"
},
"dependencies": {
"@datastructures-js/priority-queue": "^6.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-leaflet": "^4.2.1"
},
Expand Down
9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "commonjs",
"module": "ESNext",
"moduleResolution": "Node",
"skipLibCheck": true,
"emitDeclarationOnly": true,
"sourceMap": true,
"declaration": true,
"outDir": "./dist",
"declarationDir": "./dist/types",
"emitDeclarationOnly": true,
"declarationMap": true,

"allowSyntheticDefaultImports": true,
"allowImportingTsExtensions": true,
Expand All @@ -19,5 +21,6 @@
"strict": true,
},
"include": ["src/**/*"],
"exclude": ["./**/dist"],
"references": [{ "path": "./tsconfig.node.json" }]
}
14 changes: 12 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
build: {
emptyOutDir: false,
sourcemap: true,
lib: {
entry: resolve(__dirname, 'src/lib/index.ts'),
name: 'index',
fileName: 'index',
name: 'ReactTsukubaMap',
fileName: 'react-tsukuba-map',
},
rollupOptions: {
external: ['react'], // バンドルしたくない依存関係を指定
output: {
globals: {
react: 'React', // UMDビルド時に、external指定した依存関係をscript タグで読み込まれた場合に使用される変数名を指定
},
},
},
},
})

0 comments on commit bc59ff7

Please sign in to comment.