Skip to content

Commit

Permalink
fix: use mangle cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Jun 14, 2023
1 parent 9f1247b commit f0995cf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import { defineConfig } from 'rollup';
import esbuild from 'rollup-plugin-esbuild';

/** @type {Record<string, string>} */
const mangleCache = {
_key: '$k',
_effect: '$e',
_nodes: '$n',
_refs: '$r',
_init: '$i',
_value: '$v',
_sources: '$s',
_observers: '$o',
_compute: '$c',
_changed: '$ch',
_state: '$st',
_prevSibling: '$ps',
_nextSibling: '$ns',
_context: '$cx',
_handlers: '$eh',
_disposal: '$d',
};

export default defineConfig([
// dev
define({ dev: true }),
Expand Down Expand Up @@ -28,6 +48,7 @@ function define({ dev = false }) {
__TEST__: 'false',
},
mangleProps: !dev ? /^_/ : undefined,
mangleCache,
}),
],
};
Expand Down

0 comments on commit f0995cf

Please sign in to comment.