Skip to content

Commit

Permalink
Re-enable PEG.js caching to fix v1.7.0 performance regression (#116)
Browse files Browse the repository at this point in the history
* Re-enable caching for PEG.js to fix slowdown
  • Loading branch information
squ1dd13 authored Oct 21, 2024
1 parent 1690b28 commit fbbe247
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/unified-latex-util-pegjs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function pegjsLoader(options = {}): PluginOption {
};
if (filename.match(/latex\.(pegjs|peggy)$/)) {
defaultOptions.allowedStartRules = ["document", "math"];
// Avoid slow parsing as in https://github.com/siefkenj/unified-latex/issues/47
// and https://github.com/siefkenj/unified-latex/issues/115
defaultOptions.cache = true;
}
if (filename.match(/tikz\.(pegjs|peggy)$/)) {
defaultOptions.allowedStartRules = [
Expand Down

0 comments on commit fbbe247

Please sign in to comment.