mirror of
https://github.com/tiennm99/rubik.git
synced 2026-07-20 06:20:12 +00:00
fix(build): rollup treeshake 'safest' to keep cubejs static methods
'smallest' dropped cubejs's top-level `Cube.initSolver = function...` assignments, breaking the prod solver with `t.initSolver is not a function`. Tests passed because vitest uses esbuild, not rollup tree-shaking.
This commit is contained in:
@@ -8,7 +8,10 @@ export default defineConfig({
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
rollupOptions: {
|
||||
treeshake: 'smallest'
|
||||
// 'smallest' drops cubejs's top-level `Cube.initSolver = ...` static-method
|
||||
// assignments, producing `t.initSolver is not a function` at runtime.
|
||||
// 'safest' (Rollup default) preserves these side-effectful writes.
|
||||
treeshake: 'safest'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user