npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hamworks/vite-plugin-eleventy

v0.3.2

Published

A Vite plugin to build your site with 11ty

Downloads

31

Readme

Vite Plugin Eleventy

Vite plugin to build out your site with Eleventy. Allows you to use the power of 11ty to build your HTML without needing to compile it to disk during development.

Important Integration Caveats

  • Due to the nature of integrating Vite with Eleventy, not all Eleventy setups and plugins are guaranteed to work; when in doubt, consider moving to Vite plugins from Eleventy plugins (for instance, instead of using Eleventy transforms, consider writing/using a PostHTML plugin with Vite Plugin PostHTML).
  • Because Vite has built-in handling for HTML files, it's recommended to not use .html files with Eleventy. If you're writing Nunjucks, for instance, use .njk instead of .html. Don't rely on Eleventy's default template handling for HTML files is what I'm saying.

Usage

After installing, add it to your Vite config as follows:

const { eleventyPlugin } = require('vite-plugin-eleventy');

module.exports = {
  plugins: [eleventyPlugin()],
};

Config

Use an .eleventy.js configuration file to configure Eleventy.

Additionally, the following options are available for configuration; pass them in as an object when instantiating the plugin:

  • replace - Array of arrays representing replacements to be made to a glob'd path to generate an input name for Rollup. Internal arrays are in the form of [find, replace]. Will be passed to string.replace. Defaults to [[viteConfig.root, ''], ['/index.html', '']]

Important Eleventy differences

  • This plugin overrides Eleventy's input and output directories with Vite's root directory configuration. If you want to change where files live, you need to change Vite's root. This also means your 11ty template and include directories are relative to the Vite root. This also means you need to not rely on Vite plugins to set your project root. Further testing will determine if this changes in the future.