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

79 lines
1.3 KiB
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';
// import { terser } from 'rollup-plugin-terser';
const name = 'IconifyIcon';
// Module footer
const footer = `
// Export as ES module
if (typeof exports === 'object') {
try {
exports.__esModule = true;
exports.default = ${name};
} catch (err) {
}
}`;
// Export configuration
const config = [
// ES Module
{
input: `lib/${name}.js`,
output: [
{
file: `dist/${name}.esm.js`,
format: 'esm',
exports: 'named',
},
],
plugins: [resolve(), commonjs(), buble()],
},
// UMD Module
{
input: `lib/${name}.js`,
output: [
{
file: `dist/${name}.umd.js`,
format: 'umd',
name,
exports: 'named',
},
],
plugins: [resolve(), commonjs(), buble()],
},
/*
// Web and module
// "unpkg": "dist/IconifyIcon.min.js",
{
input: `lib/${name}.js`,
output: [
{
file: `dist/${name}.js`,
name,
format: 'iife',
footer,
},
],
plugins: [resolve(), commonjs(), buble()],
},
// Web
{
input: `lib/${name}.js`,
output: [
{
file: `dist/${name}.min.js`,
name,
exports: 'named',
format: 'iife',
},
],
plugins: [resolve(), commonjs(), buble(), terser()],
},
*/
];
export default config;