Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow plugins to access pathPrefix #2526

Closed
zachleat opened this issue Aug 10, 2022 · 2 comments
Closed

Allow plugins to access pathPrefix #2526

zachleat opened this issue Aug 10, 2022 · 2 comments

Comments

@zachleat
Copy link
Member

zachleat commented Aug 10, 2022

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(function(eleventyConfig) {
    // same as eleventyConfig.dir
    console.log(eleventyConfig.pathPrefix);
  });
};

Found a performance issue with the Eleventy Navigation plugin that was calling the url filter way too much, so we’re adding a new code path to bypass the url filter if pathPrefix is not used.

Eleventy:Benchmark Benchmark    312ms   9% 13934× (Configuration) "url" JavaScript Function +0ms

Shipped with @11ty/eleventy-navigation@0.3.4

@zachleat zachleat added this to the Eleventy 2.0.0 milestone Aug 10, 2022
@zachleat
Copy link
Member Author

Relevant to 11ty/eleventy-dev-server#37 (comment)

@zachleat
Copy link
Member Author

Shipping with 2.0.0-canary.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant