├── README.md ├── .gitignore ├── .npmignore ├── package.json ├── index.js └── LICENSE.md /README.md: -------------------------------------------------------------------------------- 1 | # fis-optimizer-html-minifier 2 | 3 | A optimizer plugin for fis to compress html by using html-minifier. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | node_modules/ 3 | 4 | .DS_Store 5 | *.db 6 | *.bak 7 | *.tmp 8 | *.cmd 9 | ~* 10 | 11 | upload.py -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.settings 3 | /.project 4 | /.gitignore 5 | /node_modules 6 | /test 7 | /.tmp 8 | 9 | .DS_Store 10 | 11 | *.db 12 | *.bak 13 | *.tmp 14 | *.cmd 15 | ~* 16 | 17 | upload.py -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "fis-optimizer-html-minifier", 3 | "description" : "A optimizer plugin for fis to compress html by using html-minifier.", 4 | "version" : "0.0.7", 5 | "author" : "FIS Team ", 6 | "homepage" : "http://fis.baidu.com/", 7 | "keywords": [ "fis", "html", "compress", "compressor", "minify", "minifier" ], 8 | "main" : "index.js", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/fis-dev/fis-optimizer-html-minifier.git" 12 | }, 13 | "engines" : { 14 | "node" : ">= 0.8.0" 15 | }, 16 | "scripts" : { 17 | "test" : "mocha test/ut --recursive" 18 | }, 19 | "dependencies" : { 20 | "html-minifier" : "0.5.2" 21 | } 22 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * fis 3 | * http://fis.baidu.com/ 4 | */ 5 | 6 | 'use strict'; 7 | 8 | var minify = require('html-minifier').minify; 9 | 10 | module.exports = function(content, file, conf){ 11 | return minify(content, conf); 12 | }; 13 | 14 | module.exports.defaultOptions = { 15 | // removeComments: true, 16 | // removeCommentsFromCDATA: true, 17 | // removeCDATASectionsFromCDATA: true, 18 | // collapseBooleanAttributes: true, 19 | // removeRedundantAttributes: true, 20 | // removeEmptyElements: true, 21 | // removeOptionalTags: true, 22 | // removeAttributeQuotes: true, 23 | // useShortDoctype: true, 24 | // removeEmptyAttributes: true, 25 | // removeScriptTypeAttributes: true, 26 | // removeStyleLinkTypeAttributes: true, 27 | collapseWhitespace: true 28 | }; 29 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 baidu.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 15 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 18 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------