Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 813b1ac

Browse files
committed
fix(utils): fix return object keys in createRollupInputConfig
1 parent 25667f2 commit 813b1ac

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
# Plugin hot file
27+
hot

examples/vanilla/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import java, { createRollupInputConfig } from 'vite-plugin-java'
44
export default defineConfig(() => ({
55
plugins: [java({
66
tsCompiler: 'esbuild',
7-
input: './src/main.ts',
7+
input: createRollupInputConfig(),
88
})],
99
}))

packages/vite-plugin-java/src/utils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ export function createRollupInputConfig(
4343
baseDir = 'src',
4444
): { [entryAlias: string]: string } {
4545
return Object.fromEntries(
46-
globSync(pattern).map(file => [
47-
path.relative(baseDir, file) + path.basename(file, path.extname(file)),
48-
fileURLToPath(new URL(file, import.meta.url)),
49-
]),
46+
globSync(pattern).map((file) => {
47+
return [
48+
path.relative(baseDir, path.basename(file, path.extname(file))),
49+
fileURLToPath(new URL(file, import.meta.url)),
50+
]
51+
}),
5052
)
5153
}
5254

0 commit comments

Comments
 (0)