Title: | Minify JS, CSS and HTML Files |
---|---|
Description: | Using the 'Toptal' API to minify JavaScript, CSS and HTML files. |
Authors: | Ashley Baldry [cre, aut], Toptal [aut] (Owner of the Minifier API) |
Maintainer: | Ashley Baldry <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-17 03:09:10 UTC |
Source: | https://github.com/ashbaldry/minifier |
This...
minify(code, language = MINIFY_LANGUAGES)
minify(code, language = MINIFY_LANGUAGES)
code |
Snippet of code to minify |
language |
Language of the code to minify. Options are |
https://www.toptal.com/developers/javascript-minifier/api https://www.toptal.com/developers/cssminifier/api https://www.toptal.com/developers/html-minifier/api
Using the
minifyJSDirectory( directory, single_file = TRUE, minified_dir_name = directory, minified_file_name = paste0(basename(directory), ".min.js") ) minifyCSSDirectory( directory, single_file = TRUE, minified_dir_name = directory, minified_file_name = paste0(basename(directory), ".min.css") ) minifyHTMLDirectory( directory, single_file = TRUE, minified_dir_name = directory, minified_file_name = paste0(basename(directory), ".min.html") )
minifyJSDirectory( directory, single_file = TRUE, minified_dir_name = directory, minified_file_name = paste0(basename(directory), ".min.js") ) minifyCSSDirectory( directory, single_file = TRUE, minified_dir_name = directory, minified_file_name = paste0(basename(directory), ".min.css") ) minifyHTMLDirectory( directory, single_file = TRUE, minified_dir_name = directory, minified_file_name = paste0(basename(directory), ".min.html") )
directory |
Path to the files to be minified |
single_file |
Should all the files be minified to a single file? Default set to |
minified_dir_name , minified_file_name
|
If |
Using the
minifyJSFile(file_name) minifyCSSFile(file_name) minifyHTMLFile(file_name)
minifyJSFile(file_name) minifyCSSFile(file_name) minifyHTMLFile(file_name)
file_name |
Path to the file to be minified |