1 | import { getBabelOutputPlugin } from '@rollup/plugin-babel'
|
2 | import commonjs from '@rollup/plugin-commonjs'
|
3 | import nodeResolve from '@rollup/plugin-node-resolve'
|
4 | import { decoObject, ros } from '@spare/logger'
|
5 | import BABEL_CONFIG from './babel.config.js'
|
6 | import fileInfo from 'rollup-plugin-fileinfo'
|
7 |
|
8 | const { name, dependencies, exports } = require(process.cwd() + '/package.json')
|
9 |
|
10 | console.log(ros('Executing'), name, process.cwd())
|
11 | console.log(ros('Dependencies'), decoObject(dependencies || {}, { bracket: true }))
|
12 |
|
13 | export default [
|
14 | {
|
15 | input: 'index.js',
|
16 | external: Object.keys(dependencies || {}),
|
17 | output: [
|
18 | { file: exports['import'], format: 'esm' },
|
19 | { file: exports['require'], format: 'cjs' }
|
20 | ],
|
21 | plugins: [
|
22 | nodeResolve({ preferBuiltins: true }),
|
23 | commonjs({ include: /node_modules/ }),
|
24 | getBabelOutputPlugin(BABEL_CONFIG),
|
25 | fileInfo()
|
26 | ]
|
27 | }
|
28 | ]
|