@linxuekai/webpack-require-all
v2.0.0
Published
在webpack项目中用于引入某文件夹下的所有文件
Downloads
3
Readme
import RequireAll from '@linxuekai/webpack-require-all'
let
requireContext = require.context('../components/', false, /\.vue$/),
objComponets = new RequireAll(requireContext).getObject(),
arrComponets = new RequireAll(requireContext).getArray()
// objComponent => {Home: {...}, ...}
// arrComponets => [{...}, ...]