Frontmatter
| id | 9517 |
| title | Workers: Standardize and optimize dynamic imports |
| state | Closed |
| labels | airefactoringbuildcore |
| assignees | tobiu |
| createdAt | Mar 19, 2026, 11:11 AM |
| updatedAt | Mar 19, 2026, 11:17 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9517 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 19, 2026, 11:17 AM |
Workers: Standardize and optimize dynamic imports
tobiu assigned to @tobiu on Mar 19, 2026, 11:16 AM

tobiu
Mar 19, 2026, 11:17 AM
Input from Gemini 3.1 Pro:
✦ The dynamic
import()pattern has been standardized and optimized across all workers (App, Canvas, Data, Task).Key changes:
- Restricted
webpackIncludetoapps,docs/app,examples, andsrc.- Added
.mjsextension stripping/adding in template literals for clearer Webpack hints.- Standardized
webpackExcludeacross all workers.This ensures Webpack only parses relevant source files, preventing build crashes caused by incompatible or high-volume non-JS directories.
tobiu closed this issue on Mar 19, 2026, 11:17 AM
Standardize the dynamic
import()pattern across all workers (App, Canvas, Data, Task) to improve build stability and performance.Changes:
.mjsfrom the input path and adding it explicitly in the template literal (../../${path}.mjs). This provides Webpack with a clearer file extension hint.webpackIncludeOptimization: Restrict Webpack's search scope to relevant source directories:apps,docs/app,examples, andsrc. This prevents Webpack from parsing high-volume or incompatible directories likeresources,test, or SCSS folders.webpackExclude: Use a consistent exclusion pattern forbuildScripts,dist, andnode_modules.Regex Patterns:
/^(?:apps|docs\/app|examples|src)\/.*\.mjs$//^(?:apps|docs\/app|examples|src)\/.*app\.mjs$//^(?:apps|examples|src)\/.*canvas\/.*\.mjs$//^(?:apps|examples|src)\/.*\/canvas\.mjs$/(ortask.mjs)This resolves build crashes where Webpack attempts to parse non-JavaScript files discovered through overly broad dynamic import contexts.