Frontmatter
| id | 7816 |
| title | Fix Webpack critical dependency warning in HighlightJs dynamic import |
| state | Closed |
| labels | bugrefactoring |
| assignees | tobiu |
| createdAt | Nov 19, 2025, 6:25 PM |
| updatedAt | Nov 19, 2025, 6:27 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7816 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 19, 2025, 6:27 PM |
Webpack throws a "Critical dependency" warning in
src/util/HighlightJs.mjsbecause of a dynamic import using a variable path:let path = Neo.config.basePath + 'dist/highlight/highlight.custom' + (this.debug ? '' : '.min') + '.js', module = await import(path);This is a valid use case for loading a runtime library. To fix the build warning, we need to instruct Webpack to ignore this specific import.
Solution: Add
/* webpackIgnore: true */to the import statement insrc/util/HighlightJs.mjs.module = await import(/* webpackIgnore: true */ path);