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

gulp-build-html

v1.0.17

Published

Used to process html files to automatically concat css and js files, and meanwhile update html references.

Downloads

25

Readme

NPM

Used to process html files to automatically concat css and js files, and meanwhile update html references.

Usage

This plugin works similarly as gulp-useref but supports inline scripts.

Style1

<!-- build:css ../css/index.html.allinone.css -->
<link rel = "stylesheet" href = "../css/view1/a.css"/>
<link rel = "stylesheet" href = "../css/view1/b.css"/>
<!-- endbuild -->
<!-- build:js index.html.allinone.js -->
<script type = "text/javascript" src = "../js/view1/a.js"></script>
<script type = "text/javascript" src = "../js/view1/b.js"></script>
<script type = "text/javascript">
    alert("hello, world")
</script>
<script type = "text/javascript" src = "../js/view2/c.js"></script>
<!-- endbuild -->

Style2

<slot for="merge-reference-content"
      fileType="css"
      outputLocation="file"
      outputFilePath="../css/${fileBaseName}.allinone.css"
	>
    <link rel = "stylesheet" href = "../css/view1/a.css"/>
    <link rel = "stylesheet" href = "../css/view1/b.css"/>
</slot>
<slot for="merge-reference-content"
      fileType="js"
      outputLocation="inline"
	>
    <script type = "text/javascript" src = "../js/view1/a.js"></script>
    <script type = "text/javascript" src = "../js/view1/b.js"></script>
    <script type = "text/javascript">
        alert("hello, world")
    </script>
    <script type = "text/javascript" src = "../js/view2/c.js"></script>
</slot>

Note

  1. For css build blocks, the css reference style should be like "<link rel = "stylesheet" href = "[href]"/>", or else the associated file would not be built in.

Style2 Options

  1. fileType - Target file type. Currently only css and js are supported.
  2. outputLocation - Where the concated file content should output.Supported enum values are file(which requires option outputFilePath) and inline. Value inline will output the concated content inside the html file.Currently no more actions such as uglify or minimization is supported. You may specify outputLocation to file and then use plugin gulp-resolve-import to import after uglifying or minimizing the content.Note that when building css, asset references in the source css file will be automatically adjusted to the output location.
  3. outputFilePath - Which file to create or override to output the concated reference content. Relative (to the html file) path is supported.

License

MIT