Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

HTML Pack for Node

Turns this...

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="the.css">
</head>
<body>
  <script src="vendor/jquery.js"></script>
  <script src="the.js"></script>
</body>
</html>

...into this (reformatted slightly):

<!DOCTYPE html><html><head><style>/* contents of the.css, minified */</style><body>
<script>/* contents of jquery then contents of the.js, minified */</script></body></html>

Here's how:

var path = require("path");
var pack = require("html-pack");

pack(path.resolve(__dirname, "index.html"), function(err, html) {
  console.log("index.html, inlined and minified:");
  console.log(html);
});

Not incredibly robust, so pull requests are welcome!

About

inline styles and scripts and minify everything

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.