2021-11-29 04:39:32 +02:00
|
|
|
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
|
|
import commonjs from '@rollup/plugin-commonjs'
|
2024-11-02 16:44:53 +00:00
|
|
|
import typescript from '@rollup/plugin-typescript'
|
|
|
|
import terser from '@rollup/plugin-terser'
|
2024-11-02 16:56:02 +00:00
|
|
|
import pkg from './package.json' with { type: 'json' }
|
2021-07-11 03:15:16 +03:00
|
|
|
|
|
|
|
export default [
|
|
|
|
{
|
|
|
|
input: 'src/index.ts',
|
|
|
|
output: [
|
2024-11-02 16:44:53 +00:00
|
|
|
{ file: pkg.main, format: 'cjs', sourcemap: true },
|
|
|
|
{ file: pkg.module, format: 'es', sourcemap: true },
|
2021-07-11 03:15:16 +03:00
|
|
|
],
|
|
|
|
plugins: [
|
2024-11-02 16:44:53 +00:00
|
|
|
typescript({
|
|
|
|
outDir: './dist',
|
|
|
|
sourceMap: true,
|
|
|
|
}),
|
|
|
|
nodeResolve(),
|
|
|
|
commonjs(),
|
|
|
|
],
|
2021-07-11 03:15:16 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
input: 'src/index.ts',
|
2024-11-02 16:44:53 +00:00
|
|
|
output: [{ file: pkg.browser, format: 'umd', name: 'swetrix', sourcemap: true }],
|
2021-07-11 03:15:16 +03:00
|
|
|
plugins: [
|
2024-11-02 16:44:53 +00:00
|
|
|
typescript({
|
|
|
|
outDir: './dist',
|
|
|
|
sourceMap: true,
|
|
|
|
}),
|
|
|
|
nodeResolve(),
|
|
|
|
commonjs(),
|
|
|
|
terser(),
|
|
|
|
],
|
|
|
|
},
|
2021-07-11 03:15:16 +03:00
|
|
|
]
|