瀏覽代碼

Update build structure

Make TypeScript recognize types.
tags/0.3.0
TheoryOfNekomata 4 年之前
父節點
當前提交
0dc8d65446
共有 4 個檔案被更改,包括 39 行新增35 行删除
  1. +17
    -0
      index.ts
  2. +0
    -17
      lib/index.ts
  3. +15
    -16
      rollup.config.js
  4. +7
    -2
      tsconfig.json

+ 17
- 0
index.ts 查看文件

@@ -0,0 +1,17 @@
import Button from './lib/components/Button/Button'
import Checkbox from './lib/components/Checkbox/Checkbox'
import Icon from './lib/components/Icon/Icon'
import RadioButton from './lib/components/RadioButton/RadioButton'
import Select from './lib/components/Select/Select'
import Slider from './lib/components/Slider/Slider'
import TextInput from './lib/components/TextInput/TextInput'

export {
Button,
Checkbox,
Icon,
RadioButton,
Select,
Slider,
TextInput,
}

+ 0
- 17
lib/index.ts 查看文件

@@ -1,17 +0,0 @@
import Button from './components/Button/Button'
import Checkbox from './components/Checkbox/Checkbox'
import Icon from './components/Icon/Icon'
import RadioButton from './components/RadioButton/RadioButton'
import Select from './components/Select/Select'
import Slider from './components/Slider/Slider'
import TextInput from './components/TextInput/TextInput'

export {
Button,
Checkbox,
Icon,
RadioButton,
Select,
Slider,
TextInput,
}

+ 15
- 16
rollup.config.js 查看文件

@@ -4,21 +4,20 @@ import typescript from '@rollup/plugin-typescript'

import pkg from './package.json'

const ENTRY_POINT = './lib/index.ts'
const ENTRY_POINT = './index.ts'

export default [
{
input: ENTRY_POINT,
output: {
dir: pkg.directories.lib,
format: 'cjs',
},
plugins: [
peerDepsExternal({
includeDependencies: true,
}),
typescript(),
process.env.NODE_ENV === 'production' && terser(),
],
export default {
input: ENTRY_POINT,
output: {
dir: pkg.directories.lib,
format: 'cjs',
sourcemap: true,
},
]
plugins: [
peerDepsExternal({
includeDependencies: true,
}),
typescript(),
process.env.NODE_ENV === 'production' && terser(),
],
}

+ 7
- 2
tsconfig.json 查看文件

@@ -19,9 +19,14 @@
"noEmit": true,
"jsx": "react",
"declaration": true,
"declarationDir": "./dist"
"declarationDir": "./dist",
"sourceMap": true
},
"exclude": [
"node_modules"
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"utilities/**/*",
"jest.setup.ts"
]
}

Loading…
取消
儲存