Questions tagged [copy-webpack-plugin]

25 questions
19
votes
2 answers

Error when trying to copy an empty folder with webpack

Using Webpack and copy-webpack-plugin I need to copy an entire folder during build and I have: plugins: [ new CopyPlugin({ patterns: [ { from: './src/assets', to: './assets' } ] }) ] However this fails when the assets folder is…
Miguel Moura
  • 36,732
  • 85
  • 259
  • 481
12
votes
1 answer

copy-webpack-plugin error: Invalid host defined options

Build fails after using copy-webpack-plugin. The webpack and plugin version have been tested for compatibility (webpack5 cwp10) I am running out of ideas :( Has anyone bumped onto something familiar before? Could this be a cross-module compatibility…
11
votes
1 answer

copy-webpack-plugin configuration issue

Within an electron.js app I'm trying to call and execute a python script from node.js based on the these indicatins: https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback import { execFile } from…
Raphael10
  • 2,508
  • 7
  • 22
  • 50
6
votes
1 answer

How to use flatten setting in webpack 5 copy-webpack-plugin

I use copy-webpack-plugin 10.2.0 and webpack 5.65.0. I want to copy js file in public/js folder to dist/js. plugins: [ new CopyWebpackPlugin({ patterns:[ { from:'public/js/*.js', …
Ryan
  • 19,118
  • 10
  • 37
  • 53
5
votes
1 answer

compilation.getLogger is not a function

I upgraded copy-webpack-plugin from 4.6.0 to 6.0.2 and I changed my code from plugins: [ new CopyWebpackPlugin([{ from: clientAssetPath, to: paths.STATICS, ignore: [ '.gitkeep' ], }], { debug: 'info' }), new…
Akhilesh Kumar
  • 9,085
  • 13
  • 57
  • 95
3
votes
1 answer

How do I reference the hashed image (in the html page in the dist folder) after it has been created with copy-webpack-plugin?

I have in my index.ejs file (you can consider this the .html file) a classic tag that I'm copying in the dist folder with copy-webpack-plugin. My problem is that in 'production' mode I add an hash to my image instead in the index.ejs file the…
Nick
  • 1,439
  • 2
  • 15
  • 28
3
votes
0 answers

CopyWebpackPlugin not copying files when running dev server

what I am trying to achieve I am trying to synchronise locale files from a yarn workspace to multiple Vue apps in a monorepo so they can be used with i18next in each app. They need to be: kept in sync during development automatically updated when…
Thomas Kuhlmann
  • 943
  • 7
  • 18
3
votes
2 answers

ng serve hangs up forever at 92% while processing additional asset using copy-webpack-plugin (Android OS / termux)

I was trying to run a regular angular 10 web application using my android smartphone when i came across blocking issue while ng serving the application: the ng serve is hanging on copying assets showing: "92% process additional asset…
HoUβem
  • 96
  • 1
  • 6
2
votes
0 answers

How to minimize images in subfolders with imagemin and CopyWebpack plugins?

Edit Solution I used already compressed pictures. Don't know, why. So the pictures in the subdirectories are compressed, but only if they aren't already. Goal Compress and copy all images from within directory "frontend/images" to…
leonp5
  • 305
  • 7
  • 23
1
vote
1 answer

Webpack5 how to minimize copying assets such as images

I have following webpack.config.js file, from this configuration I managed to compress all images which are consumed from css files. But I also want to compress all images which I'm copying into dist folder. const CopyPlugin =…
1
vote
0 answers

Webpack - copy-webpack-plugin - Exit status 3221225477

I use webpack with the copy-webpack-plugin. I have searched everything about this error and most likely it seems its an permission issue. Most problems are 'fixed' in newer versions while I am on an even higher/newer version. So I should be good.…
Niels Lucas
  • 739
  • 1
  • 12
  • 31
1
vote
0 answers

Encore Webpack - Copy folders structure with copy-webpack-plugin

I'm using Symfony 5 and copy-webpack-plugin. I would like copy this structure from assets/fonts to public/build/fonts…
1
vote
0 answers

CopyWebpackPlugin - TypeError: Cannot read property 'thisCompilation' of undefined

This is how I am trying to make webpack copy the JSON files in locales folder present at the root level of the project. config.plugins.push( new CopyPlugin({ patterns: [ { from: "./locales", to: "./", …
Aakash Verma
  • 3,705
  • 5
  • 29
  • 66
1
vote
1 answer

Webpack for completely static project (no JS / TS at all)

My project is a JSON schema consisting of multiple JSON files: src ├── a.json ├── b.json └── c.json All I want to do is to replace a version placeholder in this files with a version from package.json. I.e. a.json contains a ${version} (actual…
madhead
  • 31,729
  • 16
  • 153
  • 201
1
vote
0 answers

Copy JS file and parse it to JSON file using webpack

I need to copy and parse JS file with js object to JSON file using webpack. Is there any simple soluition for that, like plugin or something. I thinking to use CopyWebpackPlugin but I have no idea how to parse files to JSON
1
2