Closed Tvrqvoise closed 3 years ago
Thanks for taking the time to create PR, what is the reason from bringing in the devDependencies as dependencies? Wouldn't it make more sense that these are declared on an application level instead of package level? Especially because the package is already providing pre-build versions of the library.
@3rd-Eden I forgot to update my description for this PR, but it's there now. Essentially, anything in your babel configuration gets required, and since my package doesn't use these presets itself, it results in require errors.
It's true that this package does run babel before publish, so another alternative here would be to remove the "babel" field from package.json
and depend on the package-time transforms only. If you would rather go down this route, I can make those updates.
Because this repo declares its babel config in package.json, Babel will attempt to transform this package during runtime using the presets defined there. Because this package does not declare its Babel presets as
dependencies
, this causes node require errors unless the parent package directly depends on these packages as well:Also, I updated
babel-preset-es2015
tobabel-preset-env
, as this is the new recommendation from the Babel team.