1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| import babel from 'rollup-plugin-babel' import typescript from 'rollup-plugin-typescript2' import pkg from './package.json' import { terser } from 'rollup-plugin-terser' import postcss from 'rollup-plugin-postcss' import { resolve } from 'path'
export default { input: resolve(__dirname, './src/index.ts'), output: { name: pkg.name, exports: 'named', file: resolve(__dirname, './dist/index.js'), format: 'es', }, external: [ ...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {}), ], plugins: [ babel({ exclude: 'node_modules/**', }), typescript({ typescript: require('typescript'), }), postcss({ sourceMap: true, extract: true, minimize: true, }), terser(), ], }
|