Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-combohtml

Package Overview
Dependencies
Maintainers
5
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-combohtml

combine build html with ssi.

  • 0.1.10
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
5
Weekly downloads
 
Created
Source

grunt-combohtml

合并带有SSI的html代码,并提取其中引用的本地css和js,将他们合并为一个js和一个css,并输出构建好的html

Getting Started

依赖 Grunt 版本~0.4.1

安装

npm install grunt-combohtml --save-dev

安装后,在Gruntfile.js中载入任务

grunt.loadNpmTasks('grunt-combohtml');

任务配置

步骤

grunt.initConfig()中添加combohtml的配置:

grunt.initConfig({
	combohtml:{
		options:{
			encoding:'utf8',//输出文件编码
			replacement:{		// 抓取js/css文件时路径替换规则,留空为不替换
				from:/src\//,
				to:'build/'
			},
			comboJS:true, // 是否静态合并当前页面引用的本地js
			comboCSS:true // 是否静态合并当前页面引用的css
		},  
		main:{
			files: [
				{   
					expand: true,
					cwd:'src',
					src: ['**/*.htm'], 
					dest: 'build/',
					ext: '.htm'
				}   
			]   
		}   

	}
});

说明

该服务依赖jayli-server,支持标准格式的 SSI include

<!--#include virtual="file.html" -->

执行任务

task.run(['combohtml']);

Keywords

FAQs

Package last updated on 28 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc