webpack - Property context does not exist on type NodeRequire

感情迁移 提交于 2020-05-12 11:20:29

问题


I want to use: require.context('../images/', true, /\.(png|ico|svg|jpg|gif)$/)

but I get the following error:

Property context does not exist on type NodeRequire


回答1:


Just install the typings for webpack-env

npm i @types/webpack-env -D


来源:https://stackoverflow.com/questions/48935663/webpack-property-context-does-not-exist-on-type-noderequire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!