You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2019. It is now read-only.
Expected behavior: the loader should only emit files actually in the module (or reference) dependency tree as file dependencies to Webpack.
Actual behavior: the loader emits every single TypeScript file in the project as a dependency regardless of the entries. This can cause performance problems in watch mode.
I have one entry which is a TypeScript file with no dependencies, and at-loader is emitting hundreds of files for Webpack to watch. In my use case I am building an electron app with separate builds for the main and renderer processes. When a dependency of main changes I want to restart the main process, and when a dependency of the renderer changes I want to refresh the browser. Right now this impossible because at-loader causes Webpack to watch every single .ts file in the project, including node_modules.
When I comment out this line the loader behaves as expected and only files from the actual dependency tree of the entries are added to the Webpack compilation as dependencies.
The correctly needed dependencies are added here, and the code above in instance.ts is wasteful and unnecessary.
The text was updated successfully, but these errors were encountered:
OK, I realized there is a fatal flaw in this approach that lazy loaded modules (such as from Angular 2) don't get emitted as dependencies in this scenario.
I think a better solution is to probably specify the exact entry files that need to be parsed under "files" in tsconfig.json. This way the TypeScript compiler doesn't parse anything unnecessary.
What I need to resolve this issue is a way to pass in a list of filenames, which will be merged into the tsconfig.json as files.
Furthermore, it would be nice to be able to pass the loader an object which will be merged on top of the contents of tsconfig.json. I saw there is a configFileContent options available in instance.ts but it didn't work as expected.
Uh oh!
There was an error while loading. Please reload this page.
Expected behavior: the loader should only emit files actually in the module (or reference) dependency tree as file dependencies to Webpack.
Actual behavior: the loader emits every single TypeScript file in the project as a dependency regardless of the entries. This can cause performance problems in watch mode.
I have one entry which is a TypeScript file with no dependencies, and at-loader is emitting hundreds of files for Webpack to watch. In my use case I am building an electron app with separate builds for the main and renderer processes. When a dependency of main changes I want to restart the main process, and when a dependency of the renderer changes I want to refresh the browser. Right now this impossible because at-loader causes Webpack to watch every single .ts file in the project, including
node_modules
.I tracked the offending code down to
src/instance.ts#L368
:When I comment out this line the loader behaves as expected and only files from the actual dependency tree of the entries are added to the Webpack compilation as dependencies.
The correctly needed dependencies are added here, and the code above in
instance.ts
is wasteful and unnecessary.The text was updated successfully, but these errors were encountered: