Skip to content

Commit e625289

Browse files
authored
feat: enable preserveEntrySignatures (#253)
1 parent 5d2bba3 commit e625289

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

packages/vite/src/node/build.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@ async function buildEnvironment(
608608
)
609609

610610
const rollupOptions: RolldownOptions = {
611-
// preserveEntrySignatures: ssr
612-
// ? 'allow-extension'
613-
// : libOptions
614-
// ? 'strict'
615-
// : false,
611+
preserveEntrySignatures: ssr
612+
? 'allow-extension'
613+
: libOptions
614+
? 'strict'
615+
: false,
616616
// cache: options.watch ? undefined : false,
617617
...options.rollupOptions,
618618
output: options.rollupOptions.output,

packages/vite/src/node/plugins/worker.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,14 @@ async function bundleWorkerEntry(
102102
injectEnvironmentToHooks(workerEnvironment, chunkMetadataMap, p),
103103
),
104104
onLog(level, log) {
105-
if (
106-
log.code === 'MIXED_EXPORT' ||
107-
log.code === 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT'
108-
) {
109-
// these warning will be output because `preserveEntrySignatures` is not supported by rolldown
110-
// suppress these warnings as users do not need to care about it
111-
return
112-
}
113105
onRollupLog(level, log, workerEnvironment)
114106
},
115107
// TODO: remove this and enable rolldown's CSS support later
116108
moduleTypes: {
117109
'.css': 'js',
118110
...rollupOptions.moduleTypes,
119111
},
120-
// preserveEntrySignatures: false,
112+
preserveEntrySignatures: false,
121113
})
122114
let chunk: OutputChunk
123115
try {

playground/multiple-entrypoints/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
outDir: './dist',
77
emptyOutDir: true,
88
rollupOptions: {
9-
// preserveEntrySignatures: 'strict',
9+
preserveEntrySignatures: 'strict',
1010
input: {
1111
a0: resolve(__dirname, 'entrypoints/a0.js'),
1212
a1: resolve(__dirname, 'entrypoints/a1.js'),

0 commit comments

Comments
 (0)