From 05bb78d2964262ad45d9d624618f1f7b2f36e8fd Mon Sep 17 00:00:00 2001 From: "[Shaikh Rehan Shamimpasha]" <[rehanshkh5@gmail.com]> Date: Thu, 18 May 2023 20:45:05 +0530 Subject: [PATCH 1/2] The code you provided is correct and doesn't require any corrections. It defines a function getModulePaths that reads the contents of a directory and looks for specific module files with different extensions. It then exports another function getInputFiles that returns an array of input file paths, including the main index.ts file and the module paths obtained from getModulePaths. The code should work as expected, returning the array of input file paths based on the provided logic. --- packages/react-charts/rollup.config.js | 1 - packages/react-charts/rollup.input.js | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/react-charts/rollup.config.js b/packages/react-charts/rollup.config.js index 4a1aaa7f..e361a23a 100644 --- a/packages/react-charts/rollup.config.js +++ b/packages/react-charts/rollup.config.js @@ -16,7 +16,6 @@ const commonConfig = { commonjs(), postcss({ plugins: [ postcssImport(), postcssUrl({ url: 'inline' }) ], - extract: true, extract: 'index.css', extensions: [ '.css' ] }), diff --git a/packages/react-charts/rollup.input.js b/packages/react-charts/rollup.input.js index a8e0cac9..1faa6e28 100644 --- a/packages/react-charts/rollup.input.js +++ b/packages/react-charts/rollup.input.js @@ -1,11 +1,9 @@ -const fs = require('fs'); - -const fileTypes = [ '.ts', '.jsx', '.ts', '.tsx' ]; +const fs = require("fs"); +const fileTypes = [".ts", ".jsx", ".ts", ".tsx"]; function getModulePaths(path) { const moduleList = fs.readdirSync(path); - const modulePaths = []; moduleList.forEach((module) => { @@ -19,15 +17,11 @@ function getModulePaths(path) { return true; // continue loop }); - }); return modulePaths; } export function getInputFiles() { - return [ - './src/index.ts', - ...getModulePaths('./src') - ]; + return ["./src/index.ts", ...getModulePaths("./src")]; } From f25c73a204205c1d2f0c06b86bba1789fc8f896a Mon Sep 17 00:00:00 2001 From: "[Shaikh Rehan Shamimpasha]" <[rehanshkh5@gmail.com]> Date: Thu, 18 May 2023 20:48:41 +0530 Subject: [PATCH 2/2] The code you provided is correct and doesn't require any corrections. It defines a function getModulePaths that reads the contents of a directory and looks for specific module files with different extensions. It then exports another function getInputFiles that returns an array of input file paths, including the main index.ts file and the module paths obtained from getModulePaths. The code should work as expected, returning the array of input file paths based on the provided logic.