aboutsummaryrefslogtreecommitdiff
path: root/plugins/pluginFactory.js
blob: 385361fd56dea007bdc7505f470d0c0e1e5d9ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const pluginFactory = (configure) => (nextConfig = {}) => {
    return Object.assign({}, nextConfig, {
      webpack(config, options) {
  
        configure(config, options);
  
        if(typeof nextConfig.webpack === 'function') {
          return nextConfig.webpack(config, options);
        }
  
        return config;
      }
    });
}

module.exports = pluginFactory;