scottbrady / dustjs-browserify

Browserify plugin to convert dustjs templates to Javascript.
MIT License
4 stars 4 forks source link

Incorrect partial paths on windows #1

Open FishbaitHarry opened 9 years ago

FishbaitHarry commented 9 years ago

Problem is with: https://github.com/scottbrady/dustjs-browserify/blob/master/lib/dustjs-browserify.js#L73

1.If you generate a path in windows, it contains the \ character as separator instead of /. 2.You correctly use path.join and other utilities to construct a proper windows path. 3.On line 73 you append it to the resulting file. 4.Since you put it into resulting file without escaping, the \ character is treated as an escape character and the path becomes incorrect (like require('.\partial.dust') instead of require('.\\partial.dust')). 5.I think using something to escape the path before inserting it into file would be fine, or using unix-like paths only (since node can handle converting them to windows by itself).

kreegr commented 8 years ago

+1