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
69
votes
6 answers

npm run dev fails : ValidationError: Invalid options object

Currently learning Vue js and express js through some tutorials, I am still newbie regarding these technologies. Anyway following the tutorials I am building a small project in which I have a folder "Client" that contains the frontend side of the…
Dhouibi iheb
  • 943
  • 1
  • 6
  • 9
61
votes
10 answers

Webpack Dev Server Config - contentBase not working in latest version

When I upgrade webpack to 4.0.0-beta.3 and run npx webpack serve I get this error: [webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration has an…
roms
  • 1,511
  • 1
  • 11
  • 12
53
votes
2 answers

Getting Error from webpack-cli: "TypeError: merge is not a function" in webpack config

I'm using webpack-merge to combine two webpack.config files together but I keep getting the error "TypeError: merge is not a function when I run the command "webpack --config ./config/webpack.config.prod.js" Has anybody else run across this…
Baby Coder
  • 759
  • 1
  • 7
  • 14
19
votes
2 answers

TypeError: compiler.plugin is not a function at ReactLoadablePlugin.apply

I want to implement SSR in ReactJs using React Loadable by Webpack. Below are a few lines from the package.json file: const { ReactLoadablePlugin } = require('react-loadable/webpack'); plugins:[ new ReactLoadablePlugin({ filename:…
Sam
  • 191
  • 1
  • 1
  • 4
16
votes
12 answers

How to solve [webpack-cli] TypeError: cli.isMultipleCompiler is not a function

I got stock with with error that I dont understand, I have tried a lot of things like reinstalling all the dependencies but it does not work any idea? Here is the error prompt: No production canister_ids.json found. Continuing with…
10
votes
5 answers

Unable to load @webpack-cli/serve

I downloaded a project folder from a pluralsight tutorial, when I try to run it with npm start it shows this message: [webpack-cli] Unable to load '@webpack-cli/serve' command [webpack-cli] TypeError: options.forEach is not a function at…
Israel Juarez
  • 111
  • 1
  • 1
  • 3
9
votes
0 answers

--mode development Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook

I use webpack 5 and @ngtools/webpack together to build angular application. when i run webpack --mode development following errors appear: Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook, but a bailing hook instead. Do not…
8
votes
3 answers

Dev Server has been initialized using an options object that does not match the API schema. unknown property 'publicPath'

I am using webpack: 5.71.0 webpack-cli: 4.9.2 webpack-dev-server 4.8.1 in my webpack.config.js const path = require('path'); const webpack = require('webpack'); module.exports = { entry: './src/index.js', mode: 'development', module: { …
8
votes
2 answers

how to use "npx webpack-cli init"

mkdir demo & cd demo npm init -y npm i --save-dev webpack webpack-cli npm i webpack-cli @webpack-cli/init npx webpack-cli init but when run npx webpack-cli init i get the error init isn't a valid name. It should be prefixed with…
Martin
  • 121
  • 2
  • 10
7
votes
1 answer

webpack-cli TypeError cli.isValidationError is not a function

Unable to run the build [webpack-cli] TypeError: cli.isValidationError is not a function at Command. (/Users/lokesh/Documents/projects/newminnow/minnow-app/node_modules/@webpack-cli/serve/lib/index.js:96:25) npm ERR! code ELIFECYCL "name":…
Lokesh M
  • 71
  • 1
  • 3
7
votes
1 answer

Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead

I am getting this error Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead. new webpack.optimize.CommonsChunkPlugin({ filename: DEBUG ? 'bundle.js' : 'bundle.min.js', name:…
6
votes
0 answers

[webpack-cli][Error: EEXIST: file already exists, open '....'] - Docker environment

This is using Docker. It works when using wsl2 but when using hyper-v I'm getting the issue. I'm trying to run mix watch -- --watch-options-poll=3000 or mix --production but every time I'm running it I'm getting the following issue. [webpack-cli]…
YaBCK
  • 2,949
  • 4
  • 32
  • 61
6
votes
2 answers

TypeError: webpack.optimize.UglifyJsPlugin is not a constructor

I'm experiencing a TypeError and am unsure how to resolve it. I look forward to any help you can provide. The following is the terminal output from yarn run build: BUILD_DIR /Users/blakelucey/Desktop/fsd-next/build SRC_DIR…
Blake Lucey
  • 349
  • 1
  • 7
  • 18
6
votes
3 answers

Getting [TS] errors for files inside the node_modules folder

I just wanted to start a new typescript project using webpack5 and webpack-cli. In my surprise I'm getting these errors: Errors: hha@melchia ~/projects/project $ npm run build > my-webpack-project@1.0.0 build /home/hha/projects/project >…
Melchia
  • 22,578
  • 22
  • 103
  • 117
6
votes
4 answers

npx webpack insists on installing webpack-cli but its already installed

I am attempting to run the command: npx webpack It tells me it needs webpack-cli and asks if it should install it, I say 'yes'. Then it gives me: PS C:\_ljdev\webpack demo> npx webpack npx: installed 321 in 11.89s One CLI for webpack must be…
JTech
  • 3,420
  • 7
  • 44
  • 51
1
2 3 4 5 6