Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mingelz/combohtml
Combo your HTML files, make scripts(.js) and stylesheets(.css) inline.
https://github.com/mingelz/combohtml
Last synced: about 1 month ago
JSON representation
Combo your HTML files, make scripts(.js) and stylesheets(.css) inline.
- Host: GitHub
- URL: https://github.com/mingelz/combohtml
- Owner: mingelz
- Created: 2017-09-19T17:35:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-02T05:25:09.000Z (over 6 years ago)
- Last Synced: 2024-08-10T21:43:26.216Z (5 months ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ComboHTML
[![Version](https://img.shields.io/npm/v/combohtml.svg?style=flat)](https://www.npmjs.com/package/combohtml)
Combo your HTML files, make scripts(.js) and stylesheets(.css) inline.
## Quick start
There are 3 directives: `inline`, `compress`, `remove`, and support all HTML tags.
* if the tag is ``, ``, or `<script>`, it's accepted all 3 directives,
* otherwise it's accepted `compress` and `remove````html
<!-- inline remote file only -->
<link data-combohtml="inline" rel="stylesheet" href="//example.com/index.css"><!-- inline and compress local file -->
<script data-combohtml="inline,compress" src="./index.js"></script><!-- compress inline code -->
<style data-combohtml="compress">
div {
color: #000;
}function test (whatever) {
var one = 1
return one + whatever
}mock = "the mock data in development environment"
whatever...
```## Install
First, make sure your Node.js `>= 4`.
```shell
npm install combohtml
```## Command line usage
```shell
# process specified file
combohtml -i index.html -o dist.html# process mutiple files
combohtml --input 'src/**/*.html' --output dist
```### Command line options
```shell
-i, --input Input file(s)
-o, --output Output directory or file name
-r, --root [root] Files root path,
default to current working directory (process.cwd())
-a, --attr [attr] Specified attribute,
default to "data-combohtml"
```