https://github.com/g4code/compressor-g4
https://github.com/g4code/compressor-g4
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/g4code/compressor-g4
- Owner: g4code
- License: mit
- Created: 2015-04-03T12:22:15.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-10-06T11:45:42.000Z (almost 10 years ago)
- Last Synced: 2025-09-01T19:30:35.425Z (10 months ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 0
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
compressor-g4
======
> compressor-g4 - [nodejs](http://nodejs.org) library
## Install
$ npm install -g compressor-g4
## Usage
```
Usage: compressor [options] [dir]
Options:
-h, --help output usage information
-V, --version output the version number
-c, --config path to a configuration file (e.g. compressor/config.json)
-e, --env environment (e.g. production, stage, dev, local ...)
```
e.g.
```bash
$ compressor-g4 --config compressor/config.json --env stage
```
Inside of a twig template file
```html
{# compressor type:css name:inline_filename source:inline #}
{# compressor end #}
{# compressor type:css name:external_filename #}
{# compressor end #}
{# compressor type:js name:filename #}
{# compressor end #}
```
### Config options
* layouts: array - paths to html/template files where links for css and js files are located
* publicPath: string - path to a document root (public folder)
* tmpPath: string - path to a temp folder
* compressedFilePrefix: object for environment specific file prefix
e.g.
```
{
"layouts":[
"application/templates/layout01.twig",
"application/templates/layout02.twig"
],
"publicPath" : "../public",
"tmpPath" : "tmp",
"compressedFilePrefix" : {
"production" : "//cdn.example.com",
"stage" : "//cdn.stage.example.com",
"dev" : "//cdn.dev.int"
}
}
```
## Development
### Install dependencies
$ make install
### Run tests
$ make test
## License
(The MIT License)
see LICENSE file for details...