shampoo
Version:
The ultimate Grunt Browserify task. Run once or watch files for changes. Uses a cache for super speed (instant builds). CoffeeScript support built in. Alias mappings. Shimming. Everything in one easy to use package.
19 lines (18 loc) • 434 B
text/coffeescript
module.exports =
homeRegexp: /^\.\//
jsExtensionRegexp: /\.js$/
pathDelimiterRegexp: /\\/g
prefix: (path) ->
if path.match @homeRegexp
path
else
"./#{path}"
normalizeBuildExtension: (path) ->
if path.match @jsExtensionRegexp
path
else
"#{path}.js"
normalizePathDelimiter: (path) ->
path.replace(@pathDelimiterRegexp, '/')
rootPath: (path) ->
"./#{path}"