# Sage 10 Webpack Error

**URL:** https://discourse.roots.io/t/sage-10-webpack-error/20878
**Category:** sage
**Tags:** webpack, sage10
**Created:** 2021-06-02T10:38:51Z
**Posts:** 3

## Post 1 by @mulegoat — 2021-06-02T10:38:51Z

Hi there,

I’m using a class which references a varialbe that contains an Object.entries method which requires the path to images directory and selects all .jpg in the directory:

```
const images = Object.entries(require('../images/*.jpg'));
```

But I get a webpack error: Module not found: Error: Can’t resolve ‘…/images/\*.jpg’

If I change ‘\*’ to an actual filename in the directory the image gets added to the mix manifest and there are no errors however when I view dev tools the image is not found as its file path has been placed at the directory root rather than relative to the theme uri.

Is there a webpackConfig method that I can add to webpack.mix.js file to get this to resolve properly?

I’m only just getting started with Laravel mix so apologies if my query is unclear. Really loving Sage 10!

Many thanks in advance

---

## Post 2 by @strarsis — 2021-06-02T13:48:14Z

You seem to require multiple files at once using a glob.

Do these posts help?:

> **[webpack-import-glob](https://www.npmjs.com/package/webpack-import-glob)**
>
> ES6 import with glob patterns (preloader for Webpack)

  

> <https://stackoverflow.com/questions/32874025/how-to-add-wildcard-mapping-in-entry-of-webpack/43611910#43611910>

  

> <https://github.com/webpack/webpack/issues/1732>
>
> how to load multi static files under directory !
> module.exports = {
> entry: './assets/js/.*js',
> output: {
> filename: 'bundle.js'
> }
> };
> i am unable to find proper docmentation with...

---

## Post 3 by @mulegoat — 2021-06-03T08:17:53Z

Thank you so much starsis. I’ll have a look at these today
