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

fix(webpack): paths plugin modification to not allow multiple requests more than once #3443

Closed
wants to merge 1 commit into from

Conversation

jkuri
Copy link
Contributor

@jkuri jkuri commented Dec 7, 2016

closes #3441

@jkuri jkuri force-pushed the 3441 branch 2 times, most recently from 0c169e5 to aa236c1 Compare December 7, 2016 00:59
@hansl
Copy link
Contributor

hansl commented Dec 7, 2016

Can you add an e2e test for this PR?

@jkuri
Copy link
Contributor Author

jkuri commented Dec 7, 2016

@hansl working on it.

@jkuri jkuri force-pushed the 3441 branch 2 times, most recently from 7056ece to b0b4543 Compare December 7, 2016 22:42
@hansl
Copy link
Contributor

hansl commented Dec 8, 2016

What's the status for those tests failing?

@jkuri
Copy link
Contributor Author

jkuri commented Dec 8, 2016

solution itself is not okay. I am suspicious of a bug in webpack resolver, but not sure. I'll try to find a solution for this elsewhere in paths-plugin.ts file since previous regex was just fine.

@chrisfitz
Copy link
Contributor

FWIW, the solution I've been using to get the paths to work in my non-angular-cli webpack configuration prior to attempting to integrate @ngtools/webpack as the typescript loader was to use ts.nodeModuleNameResolver against the request and use the result of that (if any) as the new request. So far, it's worked with all the scenarios I've tried it with (including the ones I mentioned in #3441), I'm just not entirely sure if most optimal way of doing so.

@jkuri jkuri force-pushed the 3441 branch 2 times, most recently from 567ca72 to 119452e Compare December 9, 2016 16:25
@jkuri
Copy link
Contributor Author

jkuri commented Dec 9, 2016

@chrisfitz thanks for the tip! @hansl can you please check again?

@jkuri jkuri force-pushed the 3441 branch 2 times, most recently from ff9e114 to a756422 Compare December 9, 2016 17:48
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the complexity of the code comes from not replacing the pattern.

let withStarCapturing = excapedAlias.replace('\\*', '(.*)');
aliasPattern = new RegExp(`^${withStarCapturing}$`);
} else {
aliasPattern = new RegExp(`^${excapedAlias}$`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the pattern now is ^\\*$ which only matches a star? That seems really wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted.

@jkuri jkuri force-pushed the 3441 branch 4 times, most recently from bf6753e to b8dde3d Compare December 9, 2016 20:14
@jkuri jkuri force-pushed the 3441 branch 2 times, most recently from eec0860 to 1c5426c Compare December 11, 2016 03:11
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@ngtools/webpack fails when using "*" as tsconfig paths alias
5 participants