Skip to content

Commit

Permalink
Allow new js and css to go into a different directory than new html
Browse files Browse the repository at this point in the history
  • Loading branch information
bhstahl committed Jul 10, 2014
1 parent e1f834e commit 42feb1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Type: `Array`

If exist used for modify files. If does not contain string 'concat', then it added as first member of pipeline

#### ouputRelativePath
Type: `String`
Relative location to html file for new concatenated js and css.

## Use case

Expand Down
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ module.exports = function(options) {
var basePath, mainPath, mainName, alternatePath;

function createFile(name, content) {
var filePath = path.join(path.relative(basePath, mainPath), name)
var isStatic = name.split('.').pop() === 'js' || name.split('.').pop() === 'css'

if (options.ouputRelativePath && isStatic)

This comment has been minimized.

Copy link
@ledmonster

ledmonster Jul 21, 2014

This seems to be typo. "ouput" -> "output"

This comment has been minimized.

Copy link
@bhstahl

bhstahl Jul 21, 2014

Author Contributor

Sorry, not sure I'm following you?

This comment has been minimized.

Copy link
@ledmonster

ledmonster Jul 21, 2014

Alex has resolved the issue ;)

filePath = options.ouputRelativePath + name;

return new gutil.File({
path: path.join(path.relative(basePath, mainPath), name),
path: filePath,
contents: new Buffer(content)
})
}
Expand Down

0 comments on commit 42feb1a

Please sign in to comment.