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
From my understanding, the dependency graph generated by Webpack will only contain files imported through the entry file. Other files aren't inspected. However, when I build a Typescript project with webpack/ts-loader, files, and files in subdirectories, in the same folder as the entry file are being inspected by the build process even though they aren't imported anywhere.
Say for example, I have a typical webpack/typescript project. In the src folder, alongside entry.ts, I place a notInDependencyGraph.ts file with just some gibberish like 'ajlkajdflkajsdlf', which is not imported anywhere.
Webpack outputs:
ERROR in ~/test/src/scripts/notInDependencyGraph.ts
(1,1): error TS2304: Cannot find name ajlkajdflkajsdlf
Now when dealing with babel-loader in the past, webpack wouldn't even touch that file. Is this just a consequence of ts-loader, though awesome-typescript-loader has the same issue, or is it a consequence of my misunderstanding of Webpack's inner workings, which is indeed shallow.
The text was updated successfully, but these errors were encountered:
Essentially this is intended behaviour but we're open to PRs that introduce alternative behaviour that will be opt-in only (i.e. users would need to specify a ts-loader option to trigger this behaviour)
From my understanding, the dependency graph generated by Webpack will only contain files imported through the entry file. Other files aren't inspected. However, when I build a Typescript project with webpack/ts-loader, files, and files in subdirectories, in the same folder as the entry file are being inspected by the build process even though they aren't imported anywhere.
Say for example, I have a typical webpack/typescript project. In the src folder, alongside entry.ts, I place a notInDependencyGraph.ts file with just some gibberish like 'ajlkajdflkajsdlf', which is not imported anywhere.
Webpack outputs:
ERROR in ~/test/src/scripts/notInDependencyGraph.ts
(1,1): error TS2304: Cannot find name ajlkajdflkajsdlf
Now when dealing with babel-loader in the past, webpack wouldn't even touch that file. Is this just a consequence of ts-loader, though awesome-typescript-loader has the same issue, or is it a consequence of my misunderstanding of Webpack's inner workings, which is indeed shallow.
The text was updated successfully, but these errors were encountered: