2
0
mirror of https://github.com/iconify/iconify.git synced 2024-12-13 22:18:24 +00:00
iconify/components/vue/rollup.config.js

44 lines
682 B
JavaScript
Raw Normal View History

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