I have a project with Webpack and TypeScript 3.2. Recently I added the newest version of Playwright, which brings definition files with type imports (import type {APIRequestContext}
) which is a TS 3.8 feature. Code completion is broken but the Playwright tests work fine. So that's ok, I guess. But Webpack also throws errors that look like this:
ERROR in src\frontend\node_modules\@playwright\test\types\test.d.ts
[tsl] ERROR in src\frontend\node_modules\@playwright\test\types\test.d.ts(18,13)
TS1005: '=' expected.
How can Webpack throw this error? The one test file importing Playwright doesn't have any connection to the Webpack entry point. The Webpack config itself ignores anything in the node_modules folder like this
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
}
]
}