1
0
Fork 0
freesewing/packages/tutorial/rollup.config.js

30 lines
831 B
JavaScript
Raw Normal View History

import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import peerDepsExternal from 'rollup-plugin-peer-deps-external'
2020-08-08 17:20:08 +02:00
import { name, version, description, author, license, main, module, rollup } from './package.json'
2019-05-30 21:19:06 +02:00
const banner = `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
2019-05-31 18:20:29 +02:00
const output = [
{
2021-06-13 14:16:38 +02:00
banner,
2019-05-31 18:20:29 +02:00
file: main,
format: 'cjs',
sourcemap: true,
exports: rollup.exports,
2021-08-30 11:40:16 +02:00
},
]
if (typeof module !== 'undefined')
2019-05-31 18:20:29 +02:00
output.push({
2021-06-13 14:16:38 +02:00
banner,
2019-05-31 18:20:29 +02:00
file: module,
format: 'es',
2021-08-30 11:40:16 +02:00
sourcemap: true,
})
2019-05-31 18:20:29 +02:00
2019-05-30 21:19:06 +02:00
export default {
input: 'src/index.js',
2019-05-31 18:20:29 +02:00
output,
2021-08-30 11:40:16 +02:00
plugins: [peerDepsExternal(), resolve({ modulesOnly: true }), commonjs(), json()],
}