requirejs / almond

A minimal AMD API implementation for use after optimized builds
Other
2.42k stars 168 forks source link

Always remove single dots from relative paths #94

Closed gregpabian closed 8 years ago

gregpabian commented 10 years ago

Let's assume the following directory structure and files:

/
- plugin/
  - extA.js
  - extB.js
- lib/
  - core/
    - main.js
    - foo.js

main.js:

require(['../../plugin/extA', 'foo'], function (A, foo) {
    //...
});

extA.js:

define(['./extB'], function (B) {
    //...
});

extB.js:

define( function () {
    //...
});

The baseUrl in the build configuration was set to lib/core/.

This scenario will fail to run in current implementation - because of the line 77 that breaks the normalization Almond will try to load ../.././extB instead of ../../extB.

jrburke commented 8 years ago

Closing in favor of #116, which will port the change done in requirejs/requirejs#1107