Skip to content

Commit 5ea70b3

Browse files
authored
fix: respect .mjs .cjs extension in all modes (#9141)
1 parent 5a8a3ab commit 5ea70b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vite/src/node/build.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ async function doBuild(
466466
? `[name].${jsExt}`
467467
: libOptions
468468
? resolveLibFilename(libOptions, format, config.root, jsExt)
469-
: path.posix.join(options.assetsDir, `[name].[hash].js`),
469+
: path.posix.join(options.assetsDir, `[name].[hash].${jsExt}`),
470470
chunkFileNames: libOptions
471471
? `[name].[hash].${jsExt}`
472-
: path.posix.join(options.assetsDir, `[name].[hash].js`),
472+
: path.posix.join(options.assetsDir, `[name].[hash].${jsExt}`),
473473
assetFileNames: libOptions
474474
? `[name].[ext]`
475475
: path.posix.join(options.assetsDir, `[name].[hash].[ext]`),

0 commit comments

Comments
 (0)