Skip to content

Commit

Permalink
Merge pull request #51 from troisjs/rollup-plugin-dts
Browse files Browse the repository at this point in the history
Rollup plugin dts
  • Loading branch information
klevron committed Apr 28, 2021
2 parents 3131469 + 0308885 commit 7cb758f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.3",
"scripts": {
"dev": "vite",
"types": "tsc",
"build": "vue-tsc --noEmit && vite build",
"rollup": "rollup -c"
},
Expand All @@ -25,6 +26,7 @@
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^7.9.0",
"gsap": "^3.5.1",
"rollup-plugin-dts": "^3.0.1",
"rollup-plugin-esbuild": "^4.1.0",
"stats.js": "0.17.0",
"three": "^0.127",
Expand All @@ -37,7 +39,7 @@
},
"main": "build/trois.js",
"module": "build/trois.module.js",
"typings": "build/trois.d.ts",
"types": "build/trois.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/troisjs/trois.git"
Expand Down
10 changes: 10 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// import vue from 'rollup-plugin-vue'
import esbuild from 'rollup-plugin-esbuild'
import replace from '@rollup/plugin-replace'
import dts from "rollup-plugin-dts"

const input = 'src/export.ts'

Expand Down Expand Up @@ -65,4 +66,13 @@ export default [
createConfig('es', { file: 'build/trois.module.js' }),
createConfig('es', { file: 'build/trois.module.min.js' }, [], true),
createConfig('cjs', { file: 'build/trois.js' }),
{
input: 'types/export.d.ts',
external,
plugins: [dts()],
output: {
format: 'es',
file: 'build/trois.d.ts',
},
},
]
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"outDir": "types",
},
"include": ["src/**/*.ts", "src/**/*.vue"],
"exclude": ["src/components/**/*.ts"],
// "include": ["src/export.ts"],
// "exclude": ["src/App.vue", "src/main.ts"],
}

0 comments on commit 7cb758f

Please sign in to comment.