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

eleventy-load

v0.3.1

Published

Use loaders to post-process files in your Eleventy project

Downloads

148

Readme

eleventy-load ⚡

Tests npm version npm downloads License Prettier

Wish there was a way to import Sass files as easily as CSS files? Now there is!

Introducing eleventy-load, an Eleventy plugin which resolves dependencies and post-processes files for you. Loading Sass files is just one example: eleventy-load exposes 'loaders' which can process any file including HTML, CSS, JavaScript, images and more. The concept of eleventy-load is very similar to webpack loaders, albeit with infinitely less JavaScript sent to the browser.

Documentation

Visit the eleventy-load website for usage instructions, examples of eleventy-load, a list of loaders and how to write a loader yourself.

Get Started

For more detailed instructions, see the eleventy-load website.

The following example sets up eleventy-load so that you can import Sass files just like you would import CSS files.

  1. Install eleventy-load and any loaders you need.
npm install --save-dev eleventy-load eleventy-load-html eleventy-load-sass eleventy-load-css eleventy-load-file
  1. Add eleventy-load as a plugin and set up rules to process your Sass file.
module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(require("eleventy-load"), {
    rules: [
      {
        test: /\.html$/,
        loaders: [
          {
            loader: require("eleventy-load-html"),
          },
        ],
      },
      {
        test: /\.scss$/,
        loaders: [
          {
            loader: require("eleventy-load-sass"),
          },
          {
            loader: require("eleventy-load-css"),
          },
          {
            loader: require("eleventy-load-file"),
            options: {
              name: "[hash].css",
            },
          },
        ],
      },
    ],
  });
};
  1. Now you can write your Sass in a file and link it in your HTML using a link element!
$massive: 5rem;

body {
  background-color: linen;

  h1 {
    font-size: $massive;
  }
}
<link rel="stylesheet" href="styles.scss" />

It's as easy as that!

Loaders

Loaders can process any file, from a text file to images. See a list of loaders on the eleventy-load website.

Contribution

I'd love some help adding tests to eleventy-load and growing the ecosystem of loaders. If you'd like to contribute, get in touch with me!

Development

  • Clone this repo and run npm install
  • Configure your IDE to run prettier/eslint on save.
  • Run npm run test:watch which will run tests on changed files while you work.
  • Please add tests for any new features. Run npm test to lint, run tests and get a coverage report.
  • Tests will run when you push to remote

It's a pain to manually test changes against a running 11ty instance, especially for different versions. The tests make this simpler by mocking the interface to 11ty for each major version. This gives reasonable confidence that the plugin is compatible with each major 11ty release.