1.0.2 • Published 3 years ago

eleventy-njk-unpkg-inliner v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

Use this package as part of your Eleventy setup (only with Nunjucks) to download modules from npm (via unpkg) and include them as inline scripts in your templates via a shortcode.

npm i eleventy-njk-unpkg-inliner --save-dev

.eleventy.js

const unpkgInliner = require("eleventy-njk-unpkg-inliner");

module.exports = function(eleventyConfig) {
  ...

  eleventyConfig.addNunjucksAsyncShortcode('unpkgInliner', unpkgInliner);

  ...
}

some-template.njk

...

<!-- remember to use type="module" -->
<script type="module">
  /* use the path from any unpkg URL */
  {% unpkgInliner "treeboxjs@0.2.0/dist/index.js" %}
</script>

...
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago