Skip to content

EmailBuilder possibly getting wrong relativePath value #8

@JadeMatrix

Description

@JadeMatrix

On emailBuilder.js line 70 options.relativePath is set to the buffer's base, which the Gulp docs say is

Used for relative pathing. Typically where a glob starts.

This means EmailBuilder will end up trying to load CSS relative to the base path of the glob rather than each HTML file. So for example, if you glob for src/**/*.html and if one of those HTML files — say src/foo/bar.html — links to ../foo.css, Gulp will try to load src/../foo.css rather than src/foo/../foo.css. Replacing file.base with path.dirname(file.path) on at least line 70 (and possibly also line 38) results in the second behavior — relative CSS links are relative to the HTML file. Currently, the same set of CSS & HTML files can be processed with one glob but fail with another; making this change would give more predicable behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions