-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Compiler option "noEmit": true
is not honoured
#499
Comments
Hi! Thanks for reporting that. Could you share your webpack config? |
@piotr-oles Sure, here's a full reduced test case: https://github.com/OliverJAsh/fork-ts-checker-webpack-plugin-no-emit-bug. The emit time in this example is very fast, but we can still see that the emit phase is happening even though we're specifying |
@OliverJAsh
fork-ts-checker-webpack-plugin As you can see they are nearly identical and I didn't found any major difference or additional emit phase. Could you check if it's possible to reproduce this issue with the provided repository? |
@piotr-oles The emit time is very fast but the issue is that it's still happening at all, even though we specify Ideally I would be able to provide a better reduced test case which demonstrated a slow emit phase. However, I'm not sure what exactly is causing the slow emit phase, and that's a separate issue (something for TS to fix, probably). In any case, the issue I filed here is not really about the slow emit phase per se—it's more that the emit phase is running even when we tell it not to (which is a significant issue if the emit phase is slow for whatever reason, as it is on the project I work on). We can see that the emit phase is running even when we specify $ webpack
Parse Configuration: 0.01 s
Create Watch Compiler Host: 0.00 s
I/O Read: 0.02 s
Parse: 0.33 s
ResolveTypeReference: 0.01 s
ResolveModule: 0.10 s
Program: 0.48 s
Bind: 0.19 s
Check: 0.01 s
transformTime: 0.00 s
Emit: 0.01 s
Semantic Diagnostics: 0.03 s
Create Watch Program: 0.72 s
Poll And Invoke Created Or Deleted: 0.01 s
Queued Tasks: 0.00 s
Hash: 842f76e5ee7ec0f2eec2
Version: webpack 4.44.1
Time: 769ms
Built at: 08/24/2020 10:24:10
Asset Size Chunks Chunk Names
main.js 72.2 KiB 0 [emitted] main
Entrypoint main = main.js
[0] ./src/index.ts 120 bytes {0} [built]
[2] (webpack)/buildin/global.js 472 bytes {0} [built]
[3] (webpack)/buildin/module.js 497 bytes {0} [built]
+ 1 hidden module
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/ The emit phase is indeed very fast (0.01s), but nonetheless my question remains: why is the emit phase running at all, even though we specified |
If you run |
@piotr-oles I don't see it here? $ tsc --extendedDiagnostics
Files: 22
Lines: 38494
Nodes: 169672
Identifiers: 66241
Symbols: 71686
Types: 19985
Instantiations: 25088
Memory used: 99819K
Assignability cache size: 4291
Identity cache size: 50
Subtype cache size: 0
Strict subtype cache size: 0
I/O Read time: 0.01s
Parse time: 0.36s
ResolveTypeReference time: 0.01s
ResolveModule time: 0.01s
Program time: 0.40s
Bind time: 0.21s
Check time: 0.99s
Total time: 1.60s If I remove |
Could you try with |
Ah, you're right that it appears when we use However, in this case I'm not running webpack in watch mode. Should this plugin only use watch mode when webpack itself is using watch mode? |
That's a good point. I'm open for a PR to add another mode when we don't use watch mode (similar as we have special case for |
Current behavior
If I specify the compiler option
"noEmit": true
, it seems that TypeScript is still running the emit phase.Our emit phase is extremely slow for some unknown reason (multiple minutes). To workaround this, when we run
tsc
for type checking purposes we specifynoEmit
to skip the slow emit phase, which just leaves the type checking part which is very quick (multiple seconds). Unfortunately, when I tried to do the same thing using this plugin, it seems the emit phase is still running. To verify this I enabled thetypescript.profile
option, which gave me these results:Expected behavior
noEmit
should be honoured, like it is when we runtsc
.Steps to reproduce the issue
Enable
typescript.profile
andnoEmit
. In the profile results you will see the emit phase is still running, unlike when we runtsc
.Issue reproduction repository
Environment
Potentially related to #453
The text was updated successfully, but these errors were encountered: