Skip to content

Commit d017c98

Browse files
author
Maxime LUCE
committed
Append options.relative, update package.json and README.md
1 parent cf02284 commit d017c98

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ grunt.initConfig({
2525
dest: 'samples/',
2626
options: {
2727
beautify: true,
28-
prefix: '//some-cdn'
28+
prefix: '//some-cdn',
29+
relative: true,
2930
scripts: {
3031
bundle: [
3132
'<%= fixturesPath %>/scripts/*.js',
@@ -166,3 +167,4 @@ There 5 types of processors:
166167
* Allow replacing src file by built file
167168
* Allow filename in dest path
168169
* Allow prefixing src files
170+
* 0.2.1 Allow non relative file names + per file tag parameter

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-html-build",
33
"description": "Grunt HTML Builder - Appends scripts and styles, Removes debug parts, append html partials, Template options",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"homepage": "https://github.com/spatools/grunt-html-build.git",
66
"author": {
77
"name": "SPA Tools",

tasks/build-html.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,14 @@ module.exports = function (grunt) {
126126
return processHtmlTagTemplate(options, { content: content }, true);
127127
}
128128
else {
129-
return options.files.map(function (url) {
129+
return options.files.map(function (f) {
130+
var url = options.relative ? path.relative(options.dest, f) : f;
131+
url = url.replace(/\\/g, '/');
132+
130133
if (options.prefix) {
131134
url = path.join(options.prefix, url);
132135
}
136+
133137
return processHtmlTagTemplate(options, { src: url });
134138
}).join(EOL);
135139
}
@@ -190,6 +194,7 @@ module.exports = function (grunt) {
190194
params = this.options({
191195
beautify: false,
192196
logOptionals: false,
197+
relative: true,
193198
scripts: {},
194199
styles: {},
195200
sections: {},

0 commit comments

Comments
 (0)