2020-08-14 14:59:36 +02:00
|
|
|
import url from '@rollup/plugin-url'
|
|
|
|
import babel from '@rollup/plugin-babel'
|
|
|
|
import resolve from '@rollup/plugin-node-resolve'
|
|
|
|
import commonjs from '@rollup/plugin-commonjs'
|
|
|
|
import json from '@rollup/plugin-json'
|
|
|
|
import { terser } from 'rollup-plugin-terser'
|
|
|
|
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
|
|
|
|
import postcss from 'rollup-plugin-postcss'
|
|
|
|
import { name, version, description, author, license } from './package.json'
|
2018-03-04 15:43:18 -05:00
|
|
|
|
2020-08-14 14:59:36 +02:00
|
|
|
import pkg from './package.json'
|
2018-03-04 15:43:18 -05:00
|
|
|
|
|
|
|
export default {
|
2020-08-14 14:59:36 +02:00
|
|
|
input: 'src/index.js',
|
2018-03-04 15:43:18 -05:00
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: pkg.main,
|
2020-08-14 14:59:36 +02:00
|
|
|
format: 'cjs',
|
|
|
|
sourcemap: true,
|
|
|
|
exports: 'default'
|
2018-03-04 15:43:18 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
file: pkg.module,
|
2020-08-14 14:59:36 +02:00
|
|
|
format: 'es',
|
|
|
|
sourcemap: true,
|
|
|
|
exports: 'default'
|
2018-03-04 15:43:18 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
plugins: [
|
2020-08-14 14:59:36 +02:00
|
|
|
peerDepsExternal(),
|
2018-03-04 15:43:18 -05:00
|
|
|
postcss({
|
|
|
|
modules: true
|
|
|
|
}),
|
2020-08-14 14:59:36 +02:00
|
|
|
url({ exclude: ['**/*.svg'] }),
|
2018-03-04 15:43:18 -05:00
|
|
|
babel({
|
2020-08-14 14:59:36 +02:00
|
|
|
exclude: 'node_modules/**'
|
2018-03-04 15:43:18 -05:00
|
|
|
}),
|
2019-04-12 19:36:32 +02:00
|
|
|
resolve({ browser: true }),
|
|
|
|
json(),
|
2019-05-10 13:14:31 +02:00
|
|
|
commonjs(),
|
2020-08-14 14:59:36 +02:00
|
|
|
terser({
|
|
|
|
output: {
|
|
|
|
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
|
|
|
}
|
2019-05-10 13:14:31 +02:00
|
|
|
})
|
2018-03-04 15:43:18 -05:00
|
|
|
]
|
2020-08-14 14:59:36 +02:00
|
|
|
}
|