Webpack - Critical dependency: the request of a dependency is an expression

前端 未结 3 1237
野趣味
野趣味 2020-12-14 13:44

I am getting three warning messages when importing request in a barebone webpack project. A minimal example to reproduce the bug is available on GitHub (run

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 14:10

    Replace this

    new webpack.ContextReplacementPlugin(
            /angular(\\|\/)core(\\|\/)@angular/,
            helpers.root('./src'), // location of your src
            {} // a map of your routes
        ),
    

    with this-

    new webpack.ContextReplacementPlugin( /(.+)?angular(\\|\/)core(.+)?/, root('./src'), {} )
    

提交回复
热议问题