Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const extensions = ['.js', '.ts', '.tsx', '.json'];
const plugins = [
resolve({ extensions }),
commonjs({
namedExports: {
react: Object.keys(React),
'react-dom': Object.keys(ReactDOM)
}
}),
babel({ exclude: 'node_modules/**', extensions }),
replace({
'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production')
}),
!isLib && url(),
!isLib && postcss({ extract: true, sourceMap: isDev, minimize: !isDev }),
!isLib && html({ template }),
!isLib &&
copy({
targets: [
{ src: 'src/static/example_assets', dest: 'src/.dev', rename: 'assets' }
]
}),
isDev && serve('src/.dev'),
isDev && livereload(),
!isDev && terser(),
!isDev && filesize(),
isExample &&
copy({
targets: [{ src: 'src/.dev', dest: '.', rename: 'example' }],
hook: 'writeBundle'
}),
isLib &&