Webpack4:如何解析自定义加载程序?

时间:2018-09-11 21:45:03

标签: webpack angular2-nativescript

我正在尝试在项目上使用自定义加载程序,但无法使其正常运行。这是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'

0 个答案:

没有答案