Sinister Beard
Sinister Beard

Reputation: 3680

Webpack taking ages to launch before beginning build

I'm running webpack to build a very simple hello world script. It's compiling in 577ms according to the output, which would be fine, except it actually takes about 5 minutes.

I'm running it from an npm script. Here's my package JSON.

{
  "name": "es6",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "webpack --mode development",
    "build": "webpack --mode production"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "atob": "^2.1.2",
    "constants-browserify": "^1.0.0",
    "webpack": "^4.29.5",
    "webpack-cli": "^3.2.3"
  }
}

It displays webpack --mode development but then hangs for five minutes or so before doing anything else. What's up with that?

I don't have webpack installed globally by accident, I've checked that. I do have sass installed globally via NPM, could that be causing issues?

The final output is this:

λ npm run start

> [email protected] start u:\DnA\Analytics\Oli\es6
> webpack --mode development

Hash: cd6869ce2bd9b1e1c971
Version: webpack 4.29.5
Time: 557ms
Built at: 02/27/2019 4:14:28 PM
  Asset      Size  Chunks             Chunk Names
main.js  3.82 KiB    main  [emitted]  main
Entrypoint main = main.js
[./src/index.js] 43 bytes {main} [built]

Upvotes: 0

Views: 45

Answers (1)

spender
spender

Reputation: 120450

Due to the large number of small files involved in most node libraries/applications, they are not well suited to running from network drives. Move to a local drive to see things improve.

Upvotes: 1

Related Questions