Webpack throws a "Critical dependency" warning in src/util/HighlightJs.mjs because 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 in src/util/HighlightJs.mjs.
module = await import( path);
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);