Webpack production build generating no build output and almost no terminal log messages

813 Views Asked by At

Im creating my own webpack starter template and in my recent tuning I've somehow stopped the build version from working but I have no idea what's wrong or how to debug it as there no obvious error messages or such.

In my package.json I have:

  "scripts": {
    "start": "webpack-serve --open --config webpack.dev.js",
    "build": "webpack --config webpack.prod.js"
  },

My start script runs well. The build Script is not working.

The build script does this in the terminal.

$ npm run build

> [email protected] build /Users/richiekhoo/projects/webpack-tailwind-starter-template
> webpack --config webpack.prod.js
> 
> and nothing more...

Debug Attemp #1 Does webpack from the CLI work?

I ran these:

$ webpack $ webpack -v $ webpack --version

I didn't get a 'command not found' instead the command executed provided no output and exited.

Is the issue that webpack is not running properly?

I wondered is it enough to have webpack in package.json or do I need it installed globally locally and via npm as a standalone package?


Lost as to how to work out what's wrong. Please help.

Here's the code including my webpack config files:

https://github.com/demingfactor/webpack-tailwind-starter-template

1

There are 1 best solutions below

0
On

I'm running asdf and it seems there are some issues with how asdf interacts with npm.

I fixed my issue by running these commands (any of them individually could have been the fix).

$ asdf plugin-update --all

$ asdf update

$ npm i npm

I found the solutions here in the last few entries on the thread - https://github.com/asdf-vm/asdf/issues/162