Skip to content

Commit

Permalink
fix(dist): output all folders
Browse files Browse the repository at this point in the history
  • Loading branch information
ariellalgilmore committed Dec 28, 2023
1 parent 72142f0 commit 9e9ff99
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/web-components/gulp-tasks/build/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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',
Expand Down

0 comments on commit 9e9ff99

Please sign in to comment.