Skip to content

Commit 280b299

Browse files
committed
Release v1.0.0
1 parent dd69bab commit 280b299

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ gulp.task('inlinesource', function () {
5353
});
5454
```
5555

56-
Optionally, you can specify a path that will be used as the base directory for the sources (relative to gulpfile):
56+
Optionally, you can provide [some options](https://github.com/popeindustries/inline-source#usage) through an options object:
5757

5858
```javascript
5959
var gulp = require('gulp');
6060
var inlinesource = require('gulp-inline-source');
6161

6262
gulp.task('inlinesource', function () {
63+
var options = {
64+
compress: false
65+
};
66+
6367
return gulp.src('./src/*.html')
64-
.pipe(inlinesource('./assets'))
68+
.pipe(inlinesource(options))
6569
.pipe(gulp.dest('./out'));
6670
});
6771
```

index.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
var fs = require('fs'),
2-
inlineSource = require('inline-source'),
1+
var inlineSource = require('inline-source'),
32
gutil = require('gulp-util'),
43
through = require('through2');
54

65
const PLUGIN_NAME = 'gulp-inline-source';
76

8-
function gulpInlineSource(htmlpath, options) {
7+
function gulpInlineSource(options) {
98
'use strict';
109

11-
if (htmlpath && !fs.existsSync(htmlpath)) {
12-
throw new gutil.PluginError(PLUGIN_NAME, 'Path ' + htmlpath + ' cannot be found.');
13-
}
14-
1510
var stream = through.obj(function(file, enc, cb) {
1611

1712
if (file.isNull() || file.isDirectory()) {
@@ -25,8 +20,10 @@ function gulpInlineSource(htmlpath, options) {
2520
}
2621

2722
try {
28-
var filePath = htmlpath || file.cwd;
2923
options = options || {};
24+
25+
var filePath = file.cwd;
26+
3027
options.rootpath = options.rootpath || filePath;
3128

3229
var contents = inlineSource(filePath, file.contents.toString(), options);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "gulp-inline-source",
3-
"version": "0.0.3",
3+
"version": "1.0.0",
44
"description": "Inline flagged js & css sources.",
55
"license": "MIT",
6-
"author": "Filip Malinowski <[email protected]>",
6+
"author": "Filip Malinowski <[email protected]>",
77
"repository": "git://github.com/fmal/gulp-inline-source.git",
88
"keywords": [
99
"gulpplugin",

0 commit comments

Comments
 (0)