# Video folder not assets to DIST folder \[solved\]

**URL:** <https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116>\
**Category:** sage\
**Tags:** webpack\
**Created:** [March 19, 2019, 5:07pm UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116 "2019-03-19T17:07:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rerege](https://discourse.roots.io/user_avatar/discourse.roots.io/rerege/32/7209_2.png) [@rerege](https://discourse.roots.io/u/rerege)\
**Post date:** [March 19, 2019, 5:07pm UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116/1 "2019-03-19T17:07:11Z")

</div>

Hallo,  
amateur question.  
What can I asset my folder video? I read link in this forum, but there was solution via gulpfile.js, but it doesnt exist in my project.

my example:  
resources/assets/video

after:  
yarn build  
yarn start

I get link to folder /dist/video/…mp4, but the folder dist contains only  
images  
scripts  
(+styles in cache)

What can I add my folder video? config.js? If yes, how?

Thank you for help

Vana

---

<div class="post-metadata">

**Author:** ![alwaysblank](https://discourse.roots.io/user_avatar/discourse.roots.io/alwaysblank/32/11206_2.png) [@alwaysblank](https://discourse.roots.io/u/alwaysblank)\
**Post date:** [March 19, 2019, 5:17pm UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116/2 "2019-03-19T17:17:45Z")

</div>

The following section of `webpack.config.js` configures which files are copied during the build process (which I assume is all you want to do with your videos—if you need to process them in some way you would need to add a different loader to do that).

> <https://github.com/roots/sage/blob/f3e794a09374d2f110742d15b9b975490fcddbee/resources/assets/build/webpack.config.js#L146-L150>

The following line in `config.js` allows you to specify a glob that is used to by the above code to determine which files to copy, so you’d want to adjust it to include your `video` directory and the files within it.

> <https://github.com/roots/sage/blob/f3e794a09374d2f110742d15b9b975490fcddbee/resources/assets/build/config.js#L16>

---

<div class="post-metadata">

**Author:** ![rerege](https://discourse.roots.io/user_avatar/discourse.roots.io/rerege/32/7209_2.png) [@rerege](https://discourse.roots.io/u/rerege)\
**Post date:** [March 19, 2019, 5:39pm UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116/3 "2019-03-19T17:39:01Z")

</div>

> [@alwaysblank](#):
>
> copy: ‘images/\*\*/\*’,

uf, uf… yes, I want only copy from resources to dist…  
So, how can I modify config.js?

const config = merge({  
open: true,  
copy: ‘images/\*\*/\*’,

copy: ‘video/\*\*/\*’, \<\<propably stupid !

proxyUrl: ‘[http://localhost:3000](http://localhost:3000)’,

---

<div class="post-metadata">

**Author:** ![alwaysblank](https://discourse.roots.io/user_avatar/discourse.roots.io/alwaysblank/32/11206_2.png) [@alwaysblank](https://discourse.roots.io/u/alwaysblank)\
**Post date:** [March 19, 2019, 5:54pm UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116/4 "2019-03-19T17:54:55Z")

</div>

If you take a look at the source for `copy-globs-webpack-plugin`, the tool that’s being used to copy these files, you can see the format that it expects globs to be in:

> <https://github.com/QWp6t/copy-globs-webpack-plugin/blob/e8b7491f35f31ebbe7bb1d5c6c61b6c01d3c954f/src/CopyGlobsWebpackPlugin.js#L20-L32>

So in your case you would probably want:

```auto
copy: '(images|video)/**/*',

```

Globs are used quite a bit in the Sage webpack configuration, so I’d strongly recommend reading up on how they work: [https://github.com/isaacs/node-glob#glob-primer](https://github.com/isaacs/node-glob#glob-primer)

---

<div class="post-metadata">

**Author:** ![rerege](https://discourse.roots.io/user_avatar/discourse.roots.io/rerege/32/7209_2.png) [@rerege](https://discourse.roots.io/u/rerege)\
**Post date:** [March 20, 2019, 9:42am UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116/5 "2019-03-20T09:42:06Z")

</div>

@alwaysblank  
Hi Ben, thank you very much for your answer… Big help!  
Finally for me was correct this coding writting: **copy: '+(video|images)/**/\*’,\*\*

---

<div class="post-metadata">

**Author:** ![system](https://discourse.roots.io/user_avatar/discourse.roots.io/system/32/10306_2.png) [@system](https://discourse.roots.io/u/system)\
**Post date:** [April 30, 2019, 5:07pm UTC](https://discourse.roots.io/t/video-folder-not-assets-to-dist-folder-solved/15116/6 "2019-04-30T17:07:12Z")

</div>

Closed on April 30, 2019, 5:07pm UTC

This topic was automatically closed after 42 days. New replies are no longer allowed.
