silasbw / swagger-fluent

A fluent client for OpenAPI and Swagger
MIT License
8 stars 8 forks source link

is-plain-object require not working with webpack #80

Open jamesbattersby opened 4 years ago

jamesbattersby commented 4 years ago

I'm using 5.0.3 in a project using webpack, and I've found an issue with importing is-plain-object in loader.js.

const isPlainObject = require('is-plain-object')

isPlainOject ends up being a module rather than a function, so is not callable and this causes failures later on. I've worked around the problem by adding .default - but I guess this won't work for everyone.

I think this only became problem after 3.0.0 of is-plain-object. Maybe there is a setting in webpack I can use to get around this, but I'm not aware of one.