mirror of
https://github.com/iconify/iconify.git
synced 2024-12-12 21:57:50 +00:00
45 lines
756 B
JavaScript
45 lines
756 B
JavaScript
import resolve from '@rollup/plugin-node-resolve';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
const names = ['offline', 'iconify'];
|
|
const component = 'Icon';
|
|
|
|
const config = [];
|
|
|
|
// Write all packages
|
|
names.forEach((name) => {
|
|
// ES module
|
|
config.push({
|
|
input: `lib/${name}.js`,
|
|
output: [
|
|
{
|
|
file: `dist/${name}.mjs`,
|
|
format: 'esm',
|
|
exports: 'named',
|
|
},
|
|
],
|
|
external: ['vue'],
|
|
plugins: [resolve(), commonjs()],
|
|
});
|
|
|
|
// UMD module
|
|
config.push({
|
|
input: `lib/${name}.js`,
|
|
output: [
|
|
{
|
|
file: `dist/${name}.js`,
|
|
format: 'umd',
|
|
name: component,
|
|
exports: 'named',
|
|
globals: {
|
|
vue: 'Vue',
|
|
},
|
|
},
|
|
],
|
|
external: ['vue'],
|
|
plugins: [resolve(), commonjs()],
|
|
});
|
|
});
|
|
|
|
export default config;
|