Skip to content

win32 incorrect assigned module names when filenames created via path.join / resolve #426

@DimitarChristoff

Description

@DimitarChristoff

Using r.js for a custom builder of components on osx and win32 machines. for various reasons, path management in the builder is done via path.join / resolve / relative etc, which is taking into account path.sep (/ or ).

Example passed to config for r.js:

this.basePath = '../src;
this.componentPath = 'components';
var componentId = 'widget';
config.include = [ path.join(this.basePath, this.componentPath, componentId, 'main') ];

on osx this results in ../src/components/widget/main' and the resulting module gets a normalizedname` of (relative to the correct baseUrl):

define("components/widget/main", [deps], function(){});

on windows, we get the ..\\src\\components\\widget\\main passed to r.js and the module name becomes:

define("components\widget\main", [deps], function(){});

... which simply does not match any require statements in the code after. since it's for web building (URI), shouldn't there be a way to normalize the names for that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions