我正在尝试在项目上使用自定义加载程序,但无法使其正常运行。这是app/eliminateExtends.js
上的加载程序:
export default function eliminateExtends(pre) {
// Custom loader logic
return Something;
}
在webpack.config.js
上,我有以下代码:
const projectRoot = __dirname;
...
resolveLoader: {
symlinks: false,
extensions: ['.js']
},
...
{
test: /.ts$/,
use: [
{loader: "eliminateExtends"},
"nativescript-dev-webpack/moduleid-compat-loader",
"@ngtools/webpack",
]
}
但是,当我运行项目时,CLI说它可以解析文件:
ERROR in Entry module not found: Error: Can't resolve 'eliminateExtends' in 'PROJECT_DIR/app'