Questions tagged [webpack-watch]

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

When using watch mode, webpack installs file watchers to all files, which were used in the compilation process. If any change is detected, it’ll run the compilation again. When caching is enabled, webpack keeps each module in memory and will reuse it if it isn’t changed.

12 questions
3
votes
2 answers

Why does webpack --watch invoke my custom loader on unrelated files?

I have a simple custom Webpack loader which generates TypeScript code from a .txt file: txt-loader.js module.exports = function TxtLoader(txt) { console.log(`TxtLoader invoked on ${this.resourcePath} with content ${JSON.stringify(txt)}`) if…
Thomas
  • 174,939
  • 50
  • 355
  • 478
2
votes
1 answer

Hot reload from multiple watched apps on a single port

We are trying to figure out how to get webpack to hot reload multiple apps behind a single localhost port. We have a React-based single-spa (micro-frontend) system of applications in a Lerna-driven monorepo. (This is very early-stage development, so…
McGuireV10
  • 9,572
  • 5
  • 48
  • 64
2
votes
0 answers

Webpack watch config in development mode not copying css files using boilerplate created by create react app

I am developing chrome extension with react using create react app v3 boilerplate. I am using inject page strategy using content scripts. I am not using webpack dev server instead I had a watch script that watch changes and copy the updated files in…
Ghazanfar Khan
  • 3,648
  • 8
  • 44
  • 89
2
votes
0 answers

webpack plugin - problems in watch mode

TL;DR I want to pre-compile a bunch of *.tpl files to a templates.js file that can be required and used in main.js. I also want webpack in watch mode to catch changes in the .tpl files. Longer description The plugin pseudo code is something like…
Fractalf
  • 5,228
  • 3
  • 23
  • 26
1
vote
0 answers

webpack --watch gets killed while working (react), what does it mean and how to debug the problem?

I have a normal react setup, without CRA, which means I manually configured webpack and babel etc... I currently have 2 scripts which run webpack : package.json : "scripts": { "dev": "NODE_OPTIONS='--openssl-legacy-provider…
coderdonezo
  • 399
  • 1
  • 12
1
vote
1 answer

How to Ignore a Folder when using watch with Webpack

I have the following function: export default function(path, urlKey = 'static') { if (urlKey === 'static') { path = require(`~/static${path}`).default; } urlKey = Object.keys(config.app.urls).includes(urlKey) ? urlKey :…
1
vote
1 answer

Webpack run plug-in scripts on watch

I have webpack set up with a plug-in handling application files & css. webpack.config.js const path = require('path'); const glob = require('glob'); const uglify = require("uglify-js"); const cleanCSS = require("clean-css"); const merge =…
yevg
  • 1,846
  • 9
  • 34
  • 70
1
vote
1 answer

Library tooling - hooking into `webpack --watch`

I have a build step (a hook) that needs to happen after webpack --watch finishes. Has anyone had success hooking into webpack --watch to determine when it has completed? In other words it would like this: start webpack --watch in the…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1
vote
0 answers

Can webpack 2 be configured to rerun jest tests when it recompiles in watch mode?

I may have gone the wrong end of the stick here, but i want to re run my jest tests whenever the files recompile in webpacks watch mode. I understand that jest cli has its own watch mode... but as part of my dev set up i wanted to rerun jest test…
christoffee
  • 633
  • 1
  • 6
  • 15
1
vote
1 answer

Webpack out stops working on ESLint Errors.

I am not sure what the problem is. I don't want to turn emitWarnings = true because I want the emit to fail during eslint errors and to resume after eslint errors. How do allow output to continue to write after fixing eslint errors? I have tried a…
xivo
  • 2,054
  • 3
  • 22
  • 37
0
votes
2 answers

Webpack watch not allowing to listen on open port?

I've been following a guide to learn wepback and its bundling capabilities and wanted to find a way to automatically update the browser when a change was made to the code and found that --watch is one way to do so. Without any watch in the…
-1
votes
1 answer

Why I am not able to install some packages in npm?

I'm using npm andI noticed that it's not always possible to install packages. For ex I'm able to instal jquery using regular npm command npm install jquery but I'm not able to install webpack-watch-server using command npm i webpack-watch-server…
Pawel Novikov
  • 465
  • 1
  • 11
  • 26