Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
4 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,14 +1,14 @@ | |||
var fs = require('fs'); | var fs = require('fs'); | ||
|
|
||
var jsmin = require('jsmin').jsmin; | var uglify = require("uglify-js").minify; | ||
var cssmin = require('cssmin'); | var cssmin = require('cssmin'); | ||
|
|
||
var css = fs.readFileSync("src/slide.css", encoding='utf8'); | var css = fs.readFileSync("src/slide.css", encoding='utf8'); | ||
var js = fs.readFileSync("src/slide.js", encoding='utf8'); | var js = fs.readFileSync("src/slide.js", encoding='utf8'); | ||
var html = fs.readFileSync("src/slide.html", encoding='utf8'); | var html = fs.readFileSync("src/slide.html", encoding='utf8'); | ||
|
|
||
var inline = html | var inline = html | ||
.replace(/<script src="slide.js"><\/script>/, '<script>'+jsmin(js)+'</script>') | .replace(/<script src="slide.js"><\/script>/, '<script>'+uglify(js, {fromString: true}).code+'</script>') | ||
.replace(/<link .*href="slide.css">/, '<style>'+cssmin(css)+'</style>'); | .replace(/<link .*href="slide.css">/, '<style>'+cssmin(css)+'</style>'); | ||
|
|
||
console.log(inline); | console.log(inline); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters