Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
regenerator: true,
// https://github.com/webpack/webpack/issues/4039#issuecomment-273804003
// we can't have both `import` and `module.exports` in the same file.
// we can't
useESModules: false,
...opts['@babel/plugin-transform-runtime'],
}],
],
};
const env = process.env.BABEL_ENV || process.env.NODE_ENV;
if (env === 'production') {
preset.plugins.push(
require('babel-plugin-lodash'),
require('@babel/plugin-transform-react-constant-elements').default,
);
}
return preset;
};
[require('@babel/plugin-proposal-object-rest-spread').default, { useBuiltIns: true }],
require('@babel/plugin-proposal-optional-chaining').default,
[require('@babel/plugin-transform-runtime').default, {
...babelHelperVersion,
corejs: false,
regenerator: true,
helpers: true,
useESModules: opts.esModules
}],
require('@babel/plugin-syntax-dynamic-import').default,
require('babel-plugin-transform-undefined-to-void')
])
if (process.env.NODE_ENV === 'production') {
plugins.push(
require('@babel/plugin-transform-react-constant-elements').default
)
}
let themeableOptions = {
postcssrc: loadConfig('postcss', require('@instructure/ui-postcss-config')()),
themeablerc: loadConfig('themeable')
}
if (opts.themeable && typeof opts.themeable === 'object') {
const { themeablerc, postcssrc } = opts.themeable
if (themeablerc) {
themeableOptions.themeablerc = themeablerc
}
if (postcssrc) {
themeableOptions.postcssrc = postcssrc
}