Coder Social home page Coder Social logo

theetrain / gulp-resource-hints Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 64 KB

Add resource hints to your html files

Home Page: https://www.npmjs.com/package/gulp-resource-hints

License: ISC License

JavaScript 100.00%
resource-hints gulp-plugin html-files

gulp-resource-hints's People

Contributors

theetrain avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-resource-hints's Issues

Add CI tests

  • default test
  • user-defined tests (one per option)

Add README

Include

  • build status
  • tagline
  • motivation and summary
  • common example
  • example with options
  • options descriptions

Cleanup

  • simplify merge function to
function merge(opts) {
  var options = Object.assign({}, defaults, opts);
  options.paths = Object.assign({}, defaults.paths, opts.paths);
  return options
}
  • use new Set() instead of map when parsing assets to automatically remove duplicates from the array
  • use reduce to append resource hints to data variable

Write out resource hints in a sensible order

In the html file's <head>, resource hints ought to be written out in this order for maximum performance:

  • preload
  • prerender
  • dns-prefetch
  • preconnect
  • prefetch

User-submitted entries can accept an object by default, and they'll be written out as above. If they prefer, they can submit an array.

Support basic filetypes

  • images
  • fonts
  • scripts
  • stylesheets
  • videos
  • documents
    • dns-prefetch external docs in <body>
    • preconnect external docs in <head>
    • ignore internal documents

Use commented-out token

Instead of ##gulp-resource-hints## use <!-- ##gulp-resource-hints## --> for added safety.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.