-
Notifications
You must be signed in to change notification settings - Fork 12k
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
@ngtools/webpack impossible to pre-chain other loaders #8870
Comments
+1 |
yeah, pretty much the same. the code is obvious |
Damn, I wasted so much time tinkering with string-replace-loader, blaming it from not working properly, only to find out that this plugin is overriding everything what poor string-replace-loader did. Until this is fixed we probably won't be able to use AoT 😞. |
Same Problem Here! |
@gerhard17 Can you provide a sample of your workaround? I couldn't get AoT to pick up replacements, regardless of the order. |
Hi zolakt! I had a very simple use case: In WebPack-JIT I used:
Moving to WebPack-AOT I transformed it (not working) to:
So I swapped the loader order (as a quick fix). The resulting loader configuration:
Hope this helps! |
Having similar issues. Voting for this to be fixed. |
Any updates? |
My guess is that ngtools internally executes ngc, which is not a part of webpack flow and effectively ignores all the changes previous loaders have made to our precious .ts files. Here's my solution someone might find useful. I needed to make some changes to a dictionary file. It didn't have anything ng-specific in it, so I just excluded it from ngtools scope. And added a rule to compile it with ts-loader after my custom loader finishes.
This way I get client-context module processed by my loader, compiled by ts-loader and bundled by webpack. |
@elimin8r we'll discuss it during our next triage in 2019, sorry for the late response. |
This is working as intended at the moment. |
After one year of thinking... |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The use of the webpack compiler host to get file source, here:
angular-cli/packages/@ngtools/webpack/src/angular_compiler_plugin.ts
Line 831 in eb4c9e7
rather than using the, maybe changed-by-some-other-loader ヽ༼ ಠ益ಠ ༽ノ ?!! source, here:
angular-cli/packages/@ngtools/webpack/src/loader.ts
Line 548 in eb4c9e7
does not allow using other loaders before yours!
The text was updated successfully, but these errors were encountered: