2021-04-23 15:06:49 +00:00
|
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
|
2021-04-23 20:50:17 +00:00
|
|
|
const names = ['offline', 'iconify'];
|
2021-04-23 15:06:49 +00:00
|
|
|
|
2021-04-23 20:50:17 +00:00
|
|
|
const config = [];
|
2021-04-23 15:06:49 +00:00
|
|
|
|
2021-04-23 20:50:17 +00:00
|
|
|
// Write all packages
|
|
|
|
names.forEach((name) => {
|
|
|
|
// ES module
|
|
|
|
config.push({
|
2021-04-23 15:06:49 +00:00
|
|
|
input: `lib/${name}.js`,
|
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: `dist/${name}.esm.js`,
|
|
|
|
format: 'esm',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
external: ['react'],
|
2021-05-24 10:25:02 +00:00
|
|
|
plugins: [resolve(), commonjs()],
|
2021-04-23 20:50:17 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// CommonJS module
|
|
|
|
config.push({
|
2021-04-23 15:06:49 +00:00
|
|
|
input: `lib/${name}.js`,
|
|
|
|
output: [
|
|
|
|
{
|
2021-04-23 20:50:17 +00:00
|
|
|
file: `dist/${name}.js`,
|
2021-04-23 15:06:49 +00:00
|
|
|
format: 'cjs',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
external: ['react'],
|
2021-05-24 10:25:02 +00:00
|
|
|
plugins: [resolve(), commonjs()],
|
2021-04-23 20:50:17 +00:00
|
|
|
});
|
|
|
|
});
|
2021-04-23 15:06:49 +00:00
|
|
|
|
|
|
|
export default config;
|