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

Relative path ./ in modules not generating as expected? #961

Open
JohnRSim opened this issue May 19, 2017 · 0 comments
Open

Relative path ./ in modules not generating as expected? #961

JohnRSim opened this issue May 19, 2017 · 0 comments

Comments

@JohnRSim
Copy link

JohnRSim commented May 19, 2017

I have 2 files that make up my module CoreFile.js that loads in myFile.js as below

CoreFile.js

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

myFile.js

define([],function(){});

When I optimise the module with r.js lets call the output module.js it is converted like this and brings the 2 files into 1.. perfect -

optimised to module.js
module.js

define('blah/myFile',[],function(){});
define('blah/CoreFile',['./myFile'],function(){});

However shouldn't the CoreFile.js generate and update the myFile path to the module name like this -- 'blah/myFile' instead of './myFile'?

This is how I am expecting the module to generate -

define('blah/myFile',[],function(){});
define('blah/CoreFile',['blah/myFile'],function(){});

and use the module name as I've noticed that.
When I load in the optimised module.js
a call to load ./myFile' is still made instead of using the named module that is available in the module.js ie 'blah/myFile'

if I manually update the optimised module.js from './myFile' to 'blah/myFile' ie -

define('blah/myFile',[],function(){});
define('blah/CoreFile',['blah/myFile'],function(){});

then it works as intended... and there isn't a call to load in the file that has been pulled into the module..

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant