Webpack-encore: enableBuildNotifications --watch

Created on 26 Jul 2018  路  11Comments  路  Source: symfony/webpack-encore

Hi guys,

I just have started in webpack encore right now.

I have this on my webpack.config.js

var Encore = require('@symfony/webpack-encore');

Encore
// the project directory where all compiled assets will be stored
.setOutputPath('public/build/')

// the public path used by the web server to access the previous directory
.setPublicPath('/build')

// will create web/build/cve_app.js
.addEntry('cve_app', './public/assets/js/cveApp.js')

.enableBuildNotifications();

;

// export the final configuration
module.exports = Encore.getWebpackConfig();

But I just receive the notification when the first build finished, when I use --watch the notification doesn't show up..

Anyone knows whats happening ?
Thanks in advance.

Most helpful comment

Hi @hugoalexmartins,

Could you try enabling the alwaysNotify option of the webpack-notifier plugin?

Encore.enableBuildNotifications(true, (options) => {
    options.alwaysNotify = true;
});

All 11 comments

Hi @hugoalexmartins,

Could you try enabling the alwaysNotify option of the webpack-notifier plugin?

Encore.enableBuildNotifications(true, (options) => {
    options.alwaysNotify = true;
});

Hi @Lyrkan

Yes it works !

Any reason for this procedure ? I am doing anything wrong ?

Nothing wrong, that's just how the plugin works :)

that's a choice they made explicitly. By default, they notify only for failures, and for the first passing build after that: https://github.com/Turbo87/webpack-notifier#webpack-notifier

Thanks you very much !

Hey,

My mac osx gets sleep about 5min, and now the notifications aren't show up in any time...

This is weird...

this is my config:

var Encore = require('@symfony/webpack-encore');

Encore
    // the project directory where all compiled assets will be stored
    .setOutputPath('public/build/')

    // the public path used by the web server to access the previous directory
    .setPublicPath('/build')

    // will create web/build/cve_app.js
    .addEntry('cve_app', './public/assets/js/cveApp.js')

    //.enableBuildNotifications();

;

Encore.enableBuildNotifications(true, (options) => {
    options.alwaysNotify = true;
});

// export the final configuration
module.exports = Encore.getWebpackConfig();

I don't have a mac to test it but that's _probably_ not related to Encore since we are simply adding the webpack-notifier plugin to the Webpack config.

It could be an issue with the plugin itself or with node-notifier...

This is weird.

Do you think I can anything to debug and see what's happening ?

I'm not sure what to check...

Is it only the notifications part that doesn't work? Or does Webpack also stop recompiling your files?
Do the notifications start to work again after restarting Encore?

It is only the notifications part that doesn't work now.
The compilations and recompilations are working fine.
The notifications doesn't work after restart Encore.

Do you think it could be any issue with Macosx ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Growiel picture Growiel  路  3Comments

wenmingtang picture wenmingtang  路  4Comments

EliuTimana picture EliuTimana  路  4Comments

weaverryan picture weaverryan  路  4Comments

heitorvrb picture heitorvrb  路  4Comments