From 9e9ff99a467493f2690ffa3389899f62750586a2 Mon Sep 17 00:00:00 2001 From: ariellalgilmore Date: Thu, 28 Dec 2023 08:47:37 -0800 Subject: [PATCH] fix(dist): output all folders --- .../web-components/gulp-tasks/build/dist.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/web-components/gulp-tasks/build/dist.js b/packages/web-components/gulp-tasks/build/dist.js index d58363468ee..c29d403491a 100644 --- a/packages/web-components/gulp-tasks/build/dist.js +++ b/packages/web-components/gulp-tasks/build/dist.js @@ -9,12 +9,27 @@ 'use strict'; +const fs = require('fs'); const gulp = require('gulp'); +const path = require('path'); const { rollup } = require('rollup'); const getRollupConfig = require('../../tools/get-rollup-config'); const config = require('../config'); +/** + * Gets all of the folders and returns out + * + * @param {string} dir Directory to check + * @returns {string[]} List of folders + * @private + */ +function _getFolders(dir) { + return fs.readdirSync(dir).filter(file => { + return fs.statSync(path.join(dir, file)).isDirectory(); + }); +} + /** * Builds a Rollup bundle. * @@ -24,7 +39,9 @@ const config = require('../config'); * @private */ async function _buildBundle({ mode = 'development', dir = 'ltr' } = {}) { - const conf = getRollupConfig({ mode, dir }); + let folders = _getFolders(`${config.srcDir}/components`); + + const conf = getRollupConfig({ mode, dir, folders }); const bundle = await rollup(conf); await bundle.write({ format: 'es',