From 01e5fde3fa45638f3ad884ca76ad861d8781868a Mon Sep 17 00:00:00 2001 From: Ted Humphrey Date: Mon, 27 Jan 2020 18:57:39 -0500 Subject: Changes for populating ReactJS component library Modification of Maven pom.xml to segregate creation of component library away from the basic CLAMP UI. New directory ui-react-lib is introduced and populated with just a few files to support the library creation. Introduction of OnapConstants.js provides single focus for defining constants shared across multiple components, resolving circular dependency between LoopUI.js and MenuBar.js around defaultLoopName. Modified LoopSvg.js to import withRoute from react-router-dom instead of react-router, which was causing problems in usage of completed component library. Issue-ID: CLAMP-586 Change-Id: I3054d5388b8aa7417fe7566c34279390d24fb80a Signed-off-by: Ted Humphrey --- ui-react-lib/rollup.config.js | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 ui-react-lib/rollup.config.js (limited to 'ui-react-lib/rollup.config.js') diff --git a/ui-react-lib/rollup.config.js b/ui-react-lib/rollup.config.js new file mode 100755 index 00000000..c671779c --- /dev/null +++ b/ui-react-lib/rollup.config.js @@ -0,0 +1,48 @@ +import babel from 'rollup-plugin-babel' +import commonjs from '@rollup/plugin-commonjs' +import postcss from 'rollup-plugin-postcss' +import resolve from '@rollup/plugin-node-resolve' +import external from 'rollup-plugin-peer-deps-external' +import img from '@rollup/plugin-image' + +import pkg from './package.json' + +export default { + input: './libIndex.js', + output: [ + { + file: pkg.main, + format: 'cjs', + sourcemap: true + }, + { + file: pkg.module, + format: 'es', + sourcemap: true + } + ], + plugins: [ + img(), + external(), + postcss({ + modules: true + }), + babel({ + exclude: 'node_modules/**', + presets: [ + + "@babel/preset-env", {}, + "@babel/preset-react", {} + ], + plugins: [ + [ + "@babel/plugin-proposal-class-properties", + { + "loose": true + } + ] + ] + }), + resolve({ preferBuiltins: true, mainFields: ['browser'] }) + ] +} -- cgit 1.2.3-korg