grunt-combohtml
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "grunt-combohtml", | ||
"description": "combine build html with ssi.", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"homepage": "", | ||
@@ -40,7 +40,8 @@ "author": { | ||
"readmeFilename": "README.md", | ||
"_id": "grunt-combohtml@0.1.4", | ||
"_id": "grunt-combohtml@0.1.5", | ||
"_from": "grunt-combohtml@", | ||
"dist": { | ||
"shasum": "876e2218d24b85ff2c43365a7f42569528a40fed" | ||
} | ||
}, | ||
"readme": "# grunt-combohtml\n\n合并带有SSI的html代码,并提取其中引用的本地css和js,将他们合并为一个js和一个css,并输出构建好的html\n\n## Getting Started\n\n依赖 Grunt 版本`~0.4.1`\n\n安装\n\n```shell\nnpm install grunt-combohtml --save-dev\n```\n\n安装后,在Gruntfile.js中载入任务\n\n```js\ngrunt.loadNpmTasks('grunt-combohtml');\n```\n\n## \"flexcombo\" 任务配置\n\n### 步骤\n\n在`grunt.initConfig()`中添加combohtml的配置:\n\n```js\ngrunt.initConfig({\n\tcombohtml:{\n\t\toptions:{\n\t\t\tencoding:'utf8',//输出文件编码\n\t\t\treplacement:{\t\t// 抓取js/css文件时路径替换规则,留空为不替换\n\t\t\t\tfrom:/src\\//,\n\t\t\t\tto:'build/'\n\t\t\t}\n\t\t}, \n\t\tmain:{\n\t\t\tfiles: [\n\t\t\t\t{ \n\t\t\t\t\texpand: true,\n\t\t\t\t\tcwd:'src',\n\t\t\t\t\tsrc: ['**/*.htm'], \n\t\t\t\t\tdest: 'build/',\n\t\t\t\t\text: '.htm'\n\t\t\t\t} \n\t\t\t] \n\t\t} \n\n\t}\n});\n\n```\n\n## 说明\n\n该服务依赖[jayli-server](https://npmjs.org/package/jayli-server),支持标准格式的 SSI include\n\n\t<!--#include virtual=\"file.html\" -->\n\n## 执行任务\n\n\ttask.run(['combohtml']);\n" | ||
} |
@@ -85,2 +85,3 @@ // 'use strict'; | ||
var filepath = path.resolve(filepath); | ||
CTS = {}; | ||
CTS[filepath] = data; | ||
@@ -87,0 +88,0 @@ return parseOne(filepath); |
41289
1087