Skip to content

Commit ff558d2

Browse files
committed
Avoid scope sharing in dev vite build
1 parent 3030bb3 commit ff558d2

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

vite.config.mjs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ const { packageName: getPackageName, PackageCache } = require('@embroider/shared
1818

1919
export default defineConfig(({ mode }) => {
2020
process.env.EMBER_ENV = mode;
21+
22+
const build =
23+
mode === 'development'
24+
? {
25+
rollupOptions: {
26+
preserveEntrySignatures: 'strict',
27+
output: {
28+
preserveModules: true,
29+
},
30+
},
31+
minify: false,
32+
}
33+
: { minify: true };
34+
2135
return {
2236
plugins: [
2337
babel({
@@ -29,11 +43,9 @@ export default defineConfig(({ mode }) => {
2943
viteResolverBug(),
3044
version(),
3145
],
32-
optimizeDeps: { disabled: true },
46+
optimizeDeps: { noDiscovery: true },
3347
publicDir: 'tests/public',
34-
build: {
35-
minify: mode === 'production',
36-
},
48+
build,
3749
};
3850
});
3951

0 commit comments

Comments
 (0)