Skip to content

Commit

Permalink
feat: update svg-chord build
Browse files Browse the repository at this point in the history
  • Loading branch information
liningzhu committed Feb 27, 2024
1 parent 2d09652 commit beff330
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/buitar/src/components/svg-chord/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Point } from '@buitar/to-guitar'
import { SvgChordPoint } from '@buitar/svg-chord'
import type { SvgChordPoint } from '@buitar/svg-chord'

/**
* ToGuitar.Point => SvgChord.Point
Expand Down
1 change: 0 additions & 1 deletion packages/svg-chord/index.d.ts

This file was deleted.

7 changes: 3 additions & 4 deletions packages/svg-chord/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
"version": "0.0.1",
"type": "module",
"files": [
"dist",
"index.d.ts"
"dist"
],
"main": "./dist/svg-chord.umd.cjs",
"module": "./dist/svg-chord.js",
"types": "./index.d.ts",
"types": "./dist/index.d.ts",
"exports": {
"types": "./index.d.ts",
"import": "./dist/svg-chord.js",
"require": "./dist/svg-chord.umd.cjs"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build"
"build": "vite build && tsc"
},
"devDependencies": {
"typescript": "^5.3.3",
Expand Down
13 changes: 9 additions & 4 deletions packages/svg-chord/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"jsx": "react",
"jsx": "react",
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
Expand All @@ -11,14 +11,19 @@
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
// "isolatedModules": true,
// "noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,

"emitDeclarationOnly": true,
"declaration": true,
// "declarationDir": "dist",
"outFile": "dist/index.d.ts"
},
"include": ["src"]
}
30 changes: 15 additions & 15 deletions packages/svg-chord/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { defineConfig } from 'vite'

export default defineConfig({
build: {
lib: {
entry: './lib/index.tsx',
name: '@buitar/svg-chord',
},
rollupOptions: {
external: ['react', 'react-dom'], // 将 react 和 react-dom 设置为外部依赖项
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
}
build: {
lib: {
entry: './lib/index.tsx',
name: '@buitar/svg-chord',
},
rollupOptions: {
external: ['react', 'react-dom'], // 将 react 和 react-dom 设置为外部依赖项
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
},
})

0 comments on commit beff330

Please sign in to comment.