The app's compiled JavaScript entry point in dist/the-app.js also contains an export of foo with the given value.
Actual result:
The exports were optimized out.
Notes
Vite appears to default to rollup's preserveEntrySignatures = false during build (see docs). Entry points generated for apps should use strict or allow-extension instead.
Reproduction:
Create an app, for example:
Configure the app in
apps
(since we want to distribute the JS):Build the app using
vite build
.Expected result:
The app's compiled JavaScript entry point in
dist/the-app.js
also contains an export offoo
with the given value.Actual result:
The exports were optimized out.
Notes
Vite appears to default to rollup's
preserveEntrySignatures = false
during build (see docs). Entry points generated for apps should usestrict
orallow-extension
instead.