Skip to content

Commit a6a22c1

Browse files
authored
fix: Generate d.ts for dev tools so plugins can use it (#17019)
1 parent a113641 commit a6a22c1

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

vaadin-dev-server/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@koa/cors": "^4.0.0",
1313
"@open-wc/dev-server-hmr": "^0.1.2-next.0",
1414
"@open-wc/testing": "^3.1.7",
15+
"@rollup/plugin-typescript": "^11.1.1",
1516
"@types/chai": "^4.3.4",
1617
"@types/sinon": "^10.0.13",
1718
"@web/dev-server": "^0.1.35",
@@ -20,6 +21,7 @@
2021
"@web/test-runner-playwright": "^0.9.0",
2122
"prettier": "^2.8.4",
2223
"sinon": "^15.0.1",
24+
"tslib": "^2.5.3",
2325
"vite": "^4.1.4"
2426
},
2527
"dependencies": {

vaadin-dev-server/tsconfig.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@
1919
"skipLibCheck": true,
2020
"baseUrl": ".",
2121
"esModuleInterop": true,
22-
}
22+
"declaration": true,
23+
"declarationDir": "src/main/resources/META-INF/frontend/vaadin-dev-tools",
24+
"emitDeclarationOnly": true
25+
},
26+
"include": ["frontend/vaadin-dev-tools.ts"],
27+
"exclude": []
2328
}

vaadin-dev-server/vite.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { fileURLToPath } from 'url';
22
import { defineConfig } from 'vite';
3+
import typescript from '@rollup/plugin-typescript';
34

45
export default defineConfig({
56
build: {
@@ -15,6 +16,7 @@ export default defineConfig({
1516
// Ensure consistent file name for dev tools bundle
1617
entryFileNames: 'vaadin-dev-tools.js'
1718
},
19+
plugins: [typescript({ tsconfig: './tsconfig.json' })],
1820
// Do not resolve the following imports, these modules
1921
// will be provided by the application that hosts the dev tools.
2022
external: [

0 commit comments

Comments
 (0)