Video folder not assets to DIST folder [solved]

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

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).

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.

2 Likes

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’,

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:

So in your case you would probably want:

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

1 Like

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

4 Likes

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