From 8c32daa86bae23a02d795824ad85dd326a5148ab Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Mon, 18 Jan 2021 11:25:54 +0300 Subject: [PATCH] Initiated new rollup based build --- package.json | 2 + rollup.config.js | 38 +++++++++++++++++++ src/components/breadcrumb/Breadcrumb.vue | 2 +- .../cascadeselect/CascadeSelect.vue | 2 +- src/components/contextmenu/ContextMenu.vue | 2 +- src/components/datatable/BodyCell.vue | 2 +- src/components/datatable/ScrollableView.vue | 2 +- src/components/galleria/Galleria.vue | 2 +- src/components/galleria/GalleriaContent.vue | 6 +-- src/components/menu/Menu.vue | 2 +- src/components/menubar/Menubar.vue | 2 +- .../organizationchart/OrganizationChart.vue | 2 +- src/components/paginator/Paginator.vue | 14 +++---- src/components/panelmenu/PanelMenu.vue | 2 +- src/components/tieredmenu/TieredMenu.vue | 2 +- src/components/toast/Toast.vue | 2 +- src/components/tree/Tree.vue | 2 +- src/components/treetable/TreeTable.vue | 2 +- 18 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 rollup.config.js diff --git a/package.json b/package.json index 2bc3d6ce9..096d31a3c 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,8 @@ "primeicons": "4.0.0", "prismjs": "^1.15.0", "quill": "^1.3.7", + "rollup-plugin-postcss": "^4.0.0", + "rollup-plugin-vue": "^6.0.0-beta.9", "sass-loader": "^8.0.2", "vue": "3.0.3", "vue-router": "^4.0.0-0", diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 000000000..dd38df094 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,38 @@ +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; \ No newline at end of file diff --git a/src/components/breadcrumb/Breadcrumb.vue b/src/components/breadcrumb/Breadcrumb.vue index c4588abbe..e65a1d2bf 100755 --- a/src/components/breadcrumb/Breadcrumb.vue +++ b/src/components/breadcrumb/Breadcrumb.vue @@ -11,7 +11,7 @@