Babel preset to parse the Salesforce Design System React source code.
npm install @salesforce/babel-preset-design-system-react> A Babel 6 preset that makes Design System React compatible with Salesforce’s supported browsers. This enables a module bundler, such as Webpack, to transpile Design System React. Using this will make it easier to upgrade in the future without having to manually reconfigure your Babel settings to be compatible with new language features Design System React may use.
Currently contains transforms for all standard syntax that is ES2017, babel-preset-react and the following lower-stage plugins:
* proposal-object-rest-spread
* proposal-class-properties
* syntax-export-default-from
* syntax-export-extensions
* proposal-export-default
``sh`
$ npm install --save-dev @salesforce/babel-preset-design-system-react
`json`
{
"presets": ["@salesforce/babel-preset-design-system-react"]
}
`sh`
$ babel script.js --presets @salesforce/babel-preset-design-system-react
`javascript``
require('babel-core').transform('code', {
presets: ['@salesforce/babel-preset-design-system-react']
});