primevue-mirror/rollup.config.js

38 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-01-18 08:25:54 +00:00
import vue from 'rollup-plugin-vue';
import postcss from 'rollup-plugin-postcss';
const fs = require('fs-extra');
const path = require('path');
let entries = [];
fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => {
fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => {
if (file !== 'index.js' && file !== 'index.d.ts') {
let name = file.split(/(.vue)$|(.js)$/)[0].toLowerCase();
if (/\.vue$/.test(file)) {
entries.push({
input: 'src/components/' + folder + '/' + file,
external: [/\.\./],
output: [
{
format: 'esm',
file: 'dist/' + folder + '/' + name + '.esm.js'
},
{
format: 'umd',
name: 'primevue',
file: 'dist/' + folder + '/' + name + '.umd.js'
}
],
plugins: [
vue(),
postcss()
]
});
}
}
});
});
export default entries;