eeeps/eleventy-respimg

Add `addPlugin` usage to readme

zachleat opened this issue · 6 comments

A la

const pluginRss = require("@11ty/eleventy-plugin-rss");
module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(pluginRss);
};

via https://www.11ty.io/docs/plugins/

eeeps commented

@zachleat Would appreciate a quick review here... Am I doing it wrong?

eeeps commented

(Note to self, should have done a PR)

eeeps commented

One specific, possibly very dumb question: what do I get by listing eleventy in the dependencies, other than a duplicate copy of eleventy in my node_modules that will never get run because I already have a npm install -g’d version?

Is this for people who use npx, or?

(hi, I have never published code to npm before)

I think this looks to me—I’ll want to give it a spin later but the code looks solid to me.

Hmm, that’s a good question. I believe it will ensure that the version of eleventy that’s running fits the plugin’s declared version. I would hope it does at least. So if you have "@11ty/eleventy": "^0.5.2" declared and someone tried to install and use with eleventy 0.4.0, it wouldn’t be valid. I need to check this 😱

More info at https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004 (although you can use other types of versions there too if you want, not just the caret one)