webpack-属性上下文在NodeRequire类型上不存在 [英] webpack - Property context does not exist on type NodeRequire
本文介绍了webpack-属性上下文在NodeRequire类型上不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要使用:
require.context('../images/', true, /\.(png|ico|svg|jpg|gif)$/)
但出现以下错误:
NodeContext类型上不存在属性上下文
Property context does not exist on type NodeRequire
推荐答案
只需安装webpack-env
npm i @types/webpack-env -D
这篇关于webpack-属性上下文在NodeRequire类型上不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文