Giter Site home page Giter Site logo

andersdjohnson / webpack-babel-env-deps Goto Github PK

View Code? Open in Web Editor NEW
133.0 4.0 10.0 1.17 MB

Find dependencies to transpile with Babel.

Home Page: https://andersdjohnson.github.io/webpack-babel-env-deps/

License: MIT License

JavaScript 100.00%
webpack babel es6 es2015 es2016 es7 transpile babel-preset babel-preset-env transpilation

webpack-babel-env-deps's Introduction

webpack-babel-env-deps

Find dependencies to transpile with Babel.

๐Ÿ“– Read the docs!

A webpack helper to find dependencies of your project that require transpilation with Babel (and @babel/preset-env) by comparing your minimum Node.js engine against theirs (engines in package.json), and/or by determining their minimum Node.js engine or published ES2015/ES6+ source (module/jsnext:main in package.json) to require features provided by plugins and polyfills from @babel/preset-env.

webpack-babel-env-deps's People

Contributors

andersdjohnson avatar dependabot[bot] avatar matthewdordal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

webpack-babel-env-deps's Issues

Package doesn't show in babelEnvDeps.exclude()

I'm using react-dates, and when I try logging what's available in babelEnvDeps.exclude(), it's not showing up. Is there a way to enforce it?

Here is the error I was getting before I switched from exclude: [babelEnvDeps.exclude()] to exclude: /node_modules/

Error: Couldn't find preset "airbnb" relative to directory

image

Handle babel env disabled features.

We don't need to transpile certain babel env plugins that are disabled by the user in their Babel env settings.

We could sniff this from user's Babel config.

Or at least provide an option here to manually override considering certain babel env plugins from consideration for transpiling.

dist/index.js missing

It seems that in 1.6.0 dist/index.js that is defined in the "main" field in package.json is missing.

Allow non-semver versions

This error is thrown in my project

Error: Invalid version: "207-alpha1-SNAPSHOT"

Our version in package.json is sentimental, not in semver.

In error stack trace I can see above error comes from

/node_modules/webpack-babel-env-deps/node_modules/read-pkg/index.js:43:36

Not sure if this is related to your package or read-pkg or normalize-package-data. Feel free to close if I'm wrong here. Thanks.

getPluginsThatDontSatisfyModuleRange breaks when "node" missing from definition

export function getPluginsThatDontSatisfyModuleRange(plugins, range) {
  return _.pickBy(
    plugins,
    ({ node }) => !semver.satisfies(normalizeSemver(node), range)
  )
}

assumes that the plugin has a "node" field which proposal-nullish-coalescing-operator does not have. This causes the semver module to throw an error, because "undefined.0.0" is not a valid version.

Option to exclude modules detected only by mainFields

The parameter mainFields should also take boolean false parameter which would disable modules that were detected only by presence of fields such as module or jsnext:main in the package.json.

Many libraries are shipped with both commonjs and es6 builds and thus have these parameters present in package.json. In most cases bundler such as webpack or rollup will pick up proper version of the module and process the source code, so there is no need to additionally transpile it.

By default the packages should be selected only by engines settings in package.json.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.