Dileet
Dileet

Reputation: 2074

Configure webpack for next js

I'm having a hard time editing the webpack config inside my next js project (https://github.com/zeit/next.js)

I need to enable polling inside the watch options.

How can I do this inside my next.config.js file:

    webpack: function (config, {dev}) {

        if (dev) {
            watchOptions: {
                poll: true
            }
            return config
        }

        return config
    }
} 

Upvotes: 1

Views: 2828

Answers (1)

Filip Dupanović
Filip Dupanović

Reputation: 33690

That could probably be something like:

webpack (config, {dev}) {
    if (dev) {
        config.watchOptions = {
            poll: true
        }
    }

    return config
}

Upvotes: 2

Related Questions