2021-04-23 15:06:49 +00:00
|
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
|
|
|
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: [
|
|
|
|
{
|
2021-09-25 10:08:47 +00:00
|
|
|
file: `dist/${name}.mjs`,
|
2021-04-23 15:06:49 +00:00
|
|
|
format: 'esm',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
external: ['react'],
|
2021-09-25 08:43:00 +00:00
|
|
|
plugins: [resolve()],
|
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-09-25 08:43:00 +00:00
|
|
|
plugins: [resolve()],
|
2021-04-23 20:50:17 +00:00
|
|
|
});
|
|
|
|
});
|
2021-04-23 15:06:49 +00:00
|
|
|
|
|
|
|
export default config;
|