2023-01-09 13:53:00 +00:00
|
|
|
/* eslint-env node */
|
2023-05-28 07:36:05 +00:00
|
|
|
import { rimraf } from 'rimraf'
|
2022-01-08 21:41:33 +00:00
|
|
|
import babel from '@rollup/plugin-babel'
|
|
|
|
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
|
|
import commonjs from '@rollup/plugin-commonjs'
|
|
|
|
import replace from '@rollup/plugin-replace'
|
|
|
|
|
|
|
|
// remove existing distribution
|
|
|
|
rimraf('./dist', () => console.info('recreating dist'))
|
2023-01-09 13:53:00 +00:00
|
|
|
|
2022-01-08 21:41:33 +00:00
|
|
|
export default {
|
|
|
|
input: 'src/index.js',
|
|
|
|
output: {
|
|
|
|
file: 'dist/react-test.js',
|
|
|
|
sourcemap: true
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
replace({
|
|
|
|
preventAssignment: true,
|
|
|
|
'process.env.NODE_ENV': '"production"'
|
|
|
|
}),
|
|
|
|
nodeResolve({
|
|
|
|
extensions: ['.js'],
|
|
|
|
browser: true
|
|
|
|
}),
|
|
|
|
babel({
|
|
|
|
babelHelpers: 'bundled',
|
|
|
|
presets: [['@babel/preset-react', { runtime: 'automatic' }]],
|
|
|
|
exclude: 'node_modules/**'
|
|
|
|
}),
|
|
|
|
commonjs({
|
|
|
|
transformMixedEsModules: true
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|