Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createPlugins = format => {
const isFormatEs = format === 'es';
return [
peerDeps({
includeDependencies: true,
}),
babel({
extensions,
runtimeHelpers: true,
...babelOptions,
plugins: [
babelPluginImportGraphQL.default,
...babelOptions.plugins,
'babel-plugin-typescript-to-proptypes',
isFormatEs && [
'transform-rename-import',
{
replacements: [{ original: 'lodash', replacement: 'lodash-es' }],
},
],
].filter(Boolean),
}),
// To convert CJS modules to ES6
commonjs({
include: 'node_modules/**',
}),
resolve({
extensions,