Skip to content

Commit 4b7370e

Browse files
authored
fix(cli): fix rollup-plugin-typescript v12 compatiblity (#13710)
* fix(cli): fix rollup-plugin-typescript v12 compatiblity * always the same mistake
1 parent 5bbcaae commit 4b7370e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-cli: 'patch:bug'
3+
---
4+
5+
Fixed an issue in the plugin template (`tauri plugin init`) that prevented the js build command to fail.

crates/tauri-cli/templates/plugin/rollup.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { readFileSync } from 'fs'
2-
import { join } from 'path'
3-
import { cwd } from 'process'
1+
import { readFileSync } from 'node:fs'
2+
import { dirname, join } from 'node:path'
3+
import { cwd } from 'node:process'
44
import typescript from '@rollup/plugin-typescript'
55

66
const pkg = JSON.parse(readFileSync(join(cwd(), 'package.json'), 'utf8'))
@@ -20,7 +20,7 @@ export default {
2020
plugins: [
2121
typescript({
2222
declaration: true,
23-
declarationDir: `./${pkg.exports.import.split('/')[0]}`
23+
declarationDir: dirname(pkg.exports.import)
2424
})
2525
],
2626
external: [

0 commit comments

Comments
 (0)