Skip to content

Incorrect partial paths on windows #1

@FishbaitHarry

Description

@FishbaitHarry

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions