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

Allow for -.js in modules names. #1843

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ThomasK0lasa
Copy link

As per contribution guidelines I assume this fork is a one/two line fix.

User story:
In our project we use Chart.js which we defined in paths as "chartjs": "filepath". As You can see the module name is without the dot. But we also need chartjs-adapter-moment which assumes and requires module named 'chart.js'. Currently we forked the chartjs-adapter-moment and made needed change to allow working it with Require.js.

Problem:
Even if there's a 'chart.js' module defined in config.paths it won't work because Require.js assumes 'chart.js' is a file path because of the -.js.

Solution:
If there's module defined in config.paths with -.js inside then use the defined path instead first assuming that it's a js file path. Simply saying: just check first if exact name is defined in config.paths and if not then go with the old way.
If my solution is not good enough please adjust it as You like, but don't ignore the -.js module name problem.

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

Successfully merging this pull request may close these issues.

None yet

1 participant