Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Un-normalized file paths in config.buildPathToModuleIndex #525

Closed
dburrows opened this issue Sep 4, 2013 · 1 comment
Closed

Un-normalized file paths in config.buildPathToModuleIndex #525

dburrows opened this issue Sep 4, 2013 · 1 comment

Comments

@dburrows
Copy link

dburrows commented Sep 4, 2013

Came across an subtle bug while setting up a config.

config.buildPathToModuleIndex stores the module paths 'as-is' from the strings in the build.js file, but it looks like it doesn't normalise the path. This causes issues if ../ or ./ is used in the build.js file path

For example, build.js module config is

name: '../common',

then the buildPathToModuleIndex is :

{"/dev/requirejs-example-multipage-shim-withbower/www-built/js/lib/../common.js":0}

The common.js absolute file path that you get from globbing etc. ( /dev/requirejs-example-multipage-shim-withbower/www-built/js/common.js ) will never match this path so optimizing steps that depend on this will not be performed.

The bug came up when I was looking at the uglify step, as common.js was never uglified. Sorry I can't do a pull request (deadlines!) at the moment but it should just need a path.normalize on the config paths before they're stored in buildPathToModuleIndex.

@jrburke
Copy link
Member

jrburke commented Sep 20, 2013

This is fixed in master, will be part of 2.1.9, fixed in #508.

@jrburke jrburke closed this as completed Sep 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants