2020-08-23 16:01:32 +00:00
|
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
|
2021-05-06 21:28:14 +00:00
|
|
|
const names = ['offline', 'iconify'];
|
|
|
|
const component = 'Icon';
|
2020-08-23 16:01:32 +00:00
|
|
|
|
2021-05-06 21:28:14 +00:00
|
|
|
const config = [];
|
2020-08-23 16:01:32 +00:00
|
|
|
|
2021-05-06 21:28:14 +00:00
|
|
|
// Write all packages
|
|
|
|
names.forEach((name) => {
|
|
|
|
// ES module
|
|
|
|
config.push({
|
2020-08-23 16:01:32 +00:00
|
|
|
input: `lib/${name}.js`,
|
|
|
|
output: [
|
|
|
|
{
|
2021-05-06 21:28:14 +00:00
|
|
|
file: `dist/${name}.mjs`,
|
2020-08-23 16:01:32 +00:00
|
|
|
format: 'esm',
|
|
|
|
exports: 'named',
|
|
|
|
},
|
|
|
|
],
|
2021-05-06 21:28:14 +00:00
|
|
|
external: ['vue'],
|
2021-05-24 10:25:02 +00:00
|
|
|
plugins: [resolve(), commonjs()],
|
2021-05-06 21:28:14 +00:00
|
|
|
});
|
2020-08-23 16:01:32 +00:00
|
|
|
|
2021-05-06 21:28:14 +00:00
|
|
|
// UMD module
|
|
|
|
config.push({
|
2020-08-23 16:01:32 +00:00
|
|
|
input: `lib/${name}.js`,
|
|
|
|
output: [
|
|
|
|
{
|
|
|
|
file: `dist/${name}.js`,
|
2021-05-06 21:28:14 +00:00
|
|
|
format: 'umd',
|
|
|
|
name: component,
|
2020-08-23 16:01:32 +00:00
|
|
|
exports: 'named',
|
2021-05-06 21:28:14 +00:00
|
|
|
globals: {
|
|
|
|
vue: 'Vue',
|
|
|
|
},
|
2020-08-23 16:01:32 +00:00
|
|
|
},
|
|
|
|
],
|
2021-05-06 21:28:14 +00:00
|
|
|
external: ['vue'],
|
2021-05-24 10:25:02 +00:00
|
|
|
plugins: [resolve(), commonjs()],
|
2021-05-06 21:28:14 +00:00
|
|
|
});
|
|
|
|
});
|
2020-08-23 16:01:32 +00:00
|
|
|
|
|
|
|
export default config;
|