2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-10 07:11:00 +00:00
iconify/packages/vue/rollup.config.js

46 lines
819 B
JavaScript
Raw Normal View History

2020-04-28 09:47:35 +00:00
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import buble from '@rollup/plugin-buble';
2021-05-05 16:24:26 +00:00
const names = ['offline']; //, 'iconify'];
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'],
2020-04-28 09:47:35 +00:00
plugins: [resolve(), commonjs(), buble()],
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'],
2020-04-28 09:47:35 +00:00
plugins: [resolve(), commonjs(), buble()],
2021-05-05 16:24:26 +00:00
});
});
2020-04-28 09:47:35 +00:00
export default config;