const webpack = require ( 'webpack' ) ; const { produce , setAutoFreeze } = require ( 'immer' ) ; const getConfig = require ( '@proton/pack/webpack.config' ) ; module . exports = ( ... env ) => { setAutoFreeze ( false ) ; return produce ( getConfig ( ... env ) , ( config ) => { config . resolve . fallback . buffer = require . resolve ( 'buffer' ) ; config . plugins . push ( new webpack . ProvidePlugin ( { Buffer : [ require . resolve ( 'buffer' ) , 'Buffer' ] , } ) ) ; } ) ; } ;