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

grunt-inline

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-inline - npm Package Compare versions

Comparing version 0.2.0 to 0.2.2

2

package.json

@@ -9,3 +9,3 @@ {

"description": "将标记为inline的<script>、<link>、<img>等资源进行内嵌",
"version": "0.2.0",
"version": "0.2.2",
"keywords": [

@@ -12,0 +12,0 @@ "gruntplugin",

@@ -36,4 +36,4 @@ # grunt-inline[![build status](https://secure.travis-ci.org/miniflycn/grunt-inline.png)](http://travis-ci.org/miniflycn/grunt-inline)

src: [ 'dist/index.html' ]
},
},
}
}
})

@@ -57,2 +57,35 @@ ### Options

### cssmin
If cssmin is assigned true, `.css` will be minified before inlined.
```
grunt.initConfig({
inline: {
dist: {
options:{
cssmin: true
},
src: ['dist/index.html'],
dest: ['dest/']
}
}
});
```
### uglify
If uglify is assigned true, `.js` file will be minified before inlined.
```
grunt.initConfig({
inline: {
dist: {
options:{
uglify: true
},
src: ['dist/index.html'],
dest: ['dest/']
}
}
});
```
### Usage Examples

@@ -137,4 +170,7 @@

## Release History
* 2013-08-30  v0.1.6 bug fix: stylesheets ended with ">" cannot be inlined
* 2013-09-02  v0.1.7 add feature: add options.dest to assign a destination path where the source file will be copied
* 2013-10-31  v0.2.2 bug fix: img urls like 'background: url(http://www.example.com/img/bg.png)' will be transformed to 'background: url(url(http://www.example.com/img/bg.png))'
* 2013-10-30  v0.2.1 bug fix: when processing relative file path of img url in css stylesheet, forgot to transform "\" to "/" for windows users
* 2013-10-30  v0.2.0 new feature: Support for minifing js、css when they ar inlined into html.
* 2013-08-30  v0.1.9 bug fix: stylesheets ended with ">" cannot be inlined
* 2013-09-02  v0.1.9 add feature: add options.dest to assign a destination path where the source file will be copied
* 2013-09-02  v0.1.8 add feature: support for `<inline>` tag
/*
* casper-inline
* https://github.com/tactivos/casper-inline
* https://github.com/chyingp/grunt-inline
*
* Copyright (c) 2013 Auguest G. casper & IMWEB TEAM
* Copyright (c) 2014 Auguest G. casper & IMWEB TEAM
*/

@@ -79,3 +79,3 @@

if(!grunt.file.isPathAbsolute(src)){
if(isRemotePath(src) && !grunt.file.isPathAbsolute(src)){

@@ -97,3 +97,3 @@ var inlineFilePath = path.resolve( path.dirname(filepath), src );

if(!grunt.file.isPathAbsolute(src) && src.indexOf('__inline')!=-1){
if(!isRemotePath(src) && src.indexOf('__inline')!=-1){

@@ -117,3 +117,3 @@ var inlineFilePath = path.resolve( path.dirname(filepath), src ).replace(/\?.*$/, ''); // 将参数去掉

if(!grunt.file.isPathAbsolute(src) && src.indexOf('__inline')!=-1){
if(!isRemotePath(src) && src.indexOf('__inline')!=-1){

@@ -128,3 +128,3 @@ var inlineFilePath = path.resolve( path.dirname(filepath), src ).replace(/\?.*$/, ''); // 将参数去掉

styleSheetContent = styleSheetContent.replace(/url\(([^)]+)\)/g, function(matchedWord, imgUrl){
var imgUrlRelativeToParentFile = matchedWord;
var imgUrlRelativeToParentFile = imgUrl;
if(isRemotePath(imgUrl)){

@@ -131,0 +131,0 @@ // return matchedWord;

Sorry, the diff of this file is not supported yet

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