Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

196
Vistas
How do I access a webpack plugin from node?

I would like to access a webpack plugin (defined in webpack config) from a nodule script, and the call a function on it.

Say in my webpack.config there's this:

  const BrowserSyncPlugin = require('browser-sync-webpack-plugin');

  // [...]

  plugins: [
    new BrowserSyncPlugin({
      port: 5759,
      proxy: {
        target: 'http://dev.mysite.com/something',
      },
      files: [
        "wp-content/themes/theme/css/*.css",
      ],
      injectChanges: true,
    }),
  ],

  // [...]

Say that I also got a tasks.js like this:

const webpack = require('webpack');
const webpackConfig = require('./webpack.config');
const bundler = webpack(webpackConfig);

webpackConfig.plugins[1].browserSync.reload();

Well when I run node tasks.js nothing happens (browserSync won't reload).

So I'm wondering how to reach the 'real', running, browserSync (in this case, but could be any plugin) and call functions on it..

Any idea?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda