Skip to content

Commit 5eb7bae

Browse files
committed
fix: Restore ForkTsCheckerWebpackPlugin with build:true
Critical fix: ForkTsCheckerWebpackPlugin with 'build: true' is required to generate .d.ts files for plugin packages. Without this, the Docker build fails because TypeScript can't resolve imports from packages that haven't had their type definitions built. This restores the plugin with the essential configuration while still using SWC for fast transpilation.
1 parent d8f1e48 commit 5eb7bae

1 file changed

Lines changed: 17 additions & 24 deletions

File tree

superset-frontend/webpack.config.js

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -191,33 +191,26 @@ if (!isDevMode) {
191191
);
192192
}
193193

194-
// Type checking only in production builds
195-
// In Docker/CI, this runs after transpilation to catch type errors
194+
// TypeScript type checking configuration
195+
// SWC handles transpilation, but we still need ForkTsCheckerWebpackPlugin
196+
// to generate .d.ts files for the plugin packages
196197
if (!isDevMode) {
197-
// Check if plugins have been built (required for type checking)
198-
const pluginsBuilt = require('fs').existsSync(
199-
path.join(__dirname, 'packages/superset-ui-core/lib/index.d.ts'),
200-
);
201-
202-
if (pluginsBuilt) {
203-
plugins.push(
204-
new ForkTsCheckerWebpackPlugin({
205-
async: false,
206-
typescript: {
207-
memoryLimit: 4096,
208-
configOverwrite: {
209-
compilerOptions: {
210-
skipLibCheck: true,
211-
},
198+
plugins.push(
199+
new ForkTsCheckerWebpackPlugin({
200+
async: false,
201+
typescript: {
202+
memoryLimit: 4096,
203+
build: true, // CRITICAL: Generate .d.ts files for plugins
204+
mode: 'write-references', // Handle project references
205+
configOverwrite: {
206+
compilerOptions: {
207+
skipLibCheck: true,
208+
incremental: true,
212209
},
213210
},
214-
}),
215-
);
216-
} else {
217-
console.warn(
218-
'⚠️ TypeScript checking disabled - run "npm run plugins:build" first',
219-
);
220-
}
211+
},
212+
}),
213+
);
221214
}
222215

223216
const PREAMBLE = [path.join(APP_DIR, '/src/preamble.ts')];

0 commit comments

Comments
 (0)