Questions tagged [webpack-cli]

Webpack CLI is a CLI tool for providing a flexible set of commands for custom webpack projects. Use this tag for questions related with the command-line interface for webpack. Do not use for webpack in general.

Webpack CLI is a CLI tool for providing a flexible set of commands for developers to increase speed when setting up a custom webpack project. As of webpack v4, webpack is not expecting a configuration file but often, developers want to create a more custom webpack configuration based on their use-cases and needs. Exactly all these cases with webpack CLI we are providing a set of tools to improve the setup of custom webpack configuration. (1)

  1. Documentation
88 questions
1
vote
1 answer

webpack-cli Unknown argument and SyntaxError

i'm new to prestashop theme development. i had setup my local enviroment and all works fine. i try to build a theme from the classic default theme. i go into the _dev folted inside the theme and run "npm install". next i run "npm run build" to run…
1
vote
4 answers

TypeError: Cannot destructure property `logger` of 'undefined' or 'null'

I'm trying to run webpack along with webpack-dev-server but having this error: TypeError: Cannot destructure property `logger` of 'undefined' or 'null'. at Object.
monz777
  • 11
  • 1
  • 2
1
vote
0 answers

nativescript - tns run android webpack-cli error

After running tns run android, I bumped into this webpack error. I'm on the newest version of webpack Any ideas is highly appreciated.
Felix
  • 73
  • 2
  • 9
1
vote
0 answers

webpack Error: Cannot find module 'commander'

I get an error when I run in the CLI ./node_modules/.bin/webpack index.js --mode=development Here's the error: node:internal/modules/cjs/loader:903 throw err; ^ Error: Cannot find module 'commander' Require stack: -…
1
vote
1 answer

Why is webpack watch not updating my code?

I recently updated my project to webpack v5, but I can't get the watch option to work anymore. It is watching the files, and reacts when files change, but the output is never updated. Everything builds when I start the watch, but not when I make…
Rice_Crisp
  • 1,242
  • 1
  • 16
  • 33
1
vote
1 answer

webpack does not recognize command-line options

I feel kinda stupid asking this but can't find answers elsewhere. I am upgrading the webpack for our product from v1 (yes) to v4 and I'm new to all this. I installed both webpack and webpack-cli: $ ./node_modules/.bin/webpack -v webpack-cli…
davka
  • 13,974
  • 11
  • 61
  • 86
1
vote
1 answer

Why do Webpack 5 return a non-zero error code for performance hints?

Background I've just upgraded a project from Webpack 4 to Webpack 5. With the new version, it seems as if any performance hints (warnings) will make Webpack CLI to return a non-zero error code 1 when exiting the process. This breaks my production…
joakimriedel
  • 1,801
  • 12
  • 27
1
vote
1 answer

Cannot find module 'webpack-cli/bin/config-yargs', cannot find module 'webpack-cli'

I have tried nearly all solutions however nothing has worked for me. i cloned a repo from a friend and tried to run the client directory. When i try run client, i get the error: Cannot find module 'webpack-cli/bin/config-yargs' Cannot find module…
J Moss
  • 205
  • 1
  • 5
  • 13
1
vote
1 answer

CopyWebpackPlugin isn't copying static files to output directory

My files show as being emitted but they are not actually being copied to dist folder. Excerpt of compilation log: Version: webpack 4.15.1 Time: 1824ms Built at: 01/29/2020 3:51:51 PM Asset Size Chunks…
Kumar Sabnis
  • 95
  • 2
  • 13
1
vote
0 answers

Webpack: Cannot assign to read only property 'exports' of object '#'
While I was compiling code from Material Design Booststrap through Webpack, I encountered this problem in the Google Chrome console: Uncaught TypeError: Cannot assign to read only property 'exports' of object '#' The files that was used by…
crimsonpython24
  • 2,223
  • 2
  • 11
  • 27
1
vote
1 answer

enable --display-error-details in webpack to debug module imports

working on an issue where I need to enable this webpack.stats options for the cli for debugging purposes. On the base webpack.config there is no stats options enabled so it needs to be done another way. The devServer is also separated into it's own…
Dan
  • 361
  • 1
  • 5
  • 17
1
vote
1 answer

Webpack builds large production file

I don't know why but my webpack config creates very large application build (15MB single app.js file) Is there anything I can do to make this file smaller? I am builing production with yarn build-production // package.json "scripts": { …
breq
  • 24,412
  • 26
  • 65
  • 106
1
vote
0 answers

Webpack-cli init can't add an entry point

I'm running npx webpack-cli init. The first question is will your application have multiple bundles? No Then the next question: Which will be your application entry point? the prompt is there but I can't type anything in, enter does not work it…
tfantina
  • 788
  • 11
  • 37
1
vote
1 answer

Error in production build with Webpack, Babel and React - Error: Cannot find module '@babel/runtime/core-js/get-iterator'

I'm creating react application using Babel-7, Webpack. When I try to build an application in production mode following error occurred. /home/mr3/projects/my-project/node_modules/webpack-cli/bin/cli.js:231 throw err; …
mr93
  • 123
  • 2
  • 9
1
vote
1 answer

How to reduce bundle.js file size of react using webpack

I am using webpack to build my react app, it's creating 4 Mb size of bundle.js which is very huge. How can I reduce this size? Here is my webpack.config.js, what else plugins should I use? Here's a list of plugins I'm using, please suggest other…
Azhar Khan
  • 1,444
  • 2
  • 10
  • 14