3.2.0 • Published 5 years ago

@dosomething/babel-preset v3.2.0

Weekly downloads
48
License
MIT
Repository
-
Last release
5 years ago

babel-preset

This is our shared Babel preset, used when compiling JavaScript for the web at DoSomething.org.

It adds support for the latest language features in older browsers, React's JSX syntax (with optimizations for faster re-renders and smaller production builds!), pre-compiled GraphQL queries, and dynamic imports (for Webpack and Node).

We've also enabled support for the export extensions and object spread properties proposals.

Getting Started

Install this package via NPM:

npm install @babel/core @dosomething/babel-preset --save-dev
npm install @babel/runtime core-js --save

Specify as a preset in your package.json:

{
  // ...
  "babel": {
    "presets": [
      "@dosomething"
    ]
  }
}

Configuration

By default, polyfills for any newer platform features used in your application will be included in your compiled bundle. If this project doesn't support older browsers or is using a polyfill service, you can opt out like so:

{
  // ...
  "babel": {
    "presets": [
      ["@dosomething", { "withPolyfills": false }]
    ]
  }
}

License

© DoSomething.org. Our Babel preset is free software, and may be redistributed under the terms specified in the LICENSE file. The name and logo for DoSomething.org are trademarks of Do Something, Inc and may not be used without permission.