omit.js icon indicating copy to clipboard operation
omit.js copied to clipboard

Acts weird when using with webpack

Open spence-s opened this issue 5 years ago • 0 comments

When bundling with webpack.

// import omit from 'omit.js'; <== works
// const omit = require('omit.js').default; <== works
// const omit = require('omit.js'); <== does NOT work
console.log(omit({ foo: 'foo', bar: 'bar' }, ['bar'])); 

May just want to better support commonjs - if a library uses this package internally and requires it via require('omit.js') - and then webpack is used to bundle the lib omit will always be undefined.

I ran into this issue when trying to bundle cabin with webpack and omit would always be undefined. The author switched to lodash/omit to remedy the issue.

spence-s avatar Aug 01 '20 21:08 spence-s