I built an app that relies on a third-party library with the following syntax:
const module = await import(`data:text/javascript;charset=utf-8,${content}`);
While using Webpack to build the app, I encountered this error:
ERROR in ./node_modules/@web/test-runner-commands/browser/commands.mjs
Module not found: Error: Can't resolve 'data:text' in 'C:\path_to_project\node_modules\@web\test-runner-commands\browser'
I attempted to resolve the issue by adding babel-loader to my Webpack configuration:
module: {
rules: [
{
test: /\.m?js$/,
include: [
path.resolve(workingDirectory, 'node_modules/@web')
],
use: 'babel-loader'
}
]
}
I'm seeking assistance in determining the appropriate loader to interpret the expression.