From 812d0d91c0c33911b75091e950adfd50d6da4b10 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 13 Jul 2021 08:30:51 +0200 Subject: [PATCH] using sync versions to work with nodejs 12.x nothing to gain from the async/promises version --- rollup.config.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 6be5b2a6d3..2ba5ced810 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -11,10 +11,9 @@ import path from 'path'; import babel from '@babel/core'; -import { readFileSync } from "fs"; +import { readFileSync, readdirSync, statSync } from "fs"; import rimraf from 'rimraf'; import { minify } from 'terser'; -import { readdir,stat } from 'fs/promises'; import resolve from '@rollup/plugin-node-resolve'; // Best practice: use this @@ -144,21 +143,21 @@ const config = { * * @return Promise */ -export default async function addAppsConfig() +export default function addAppsConfig() { const conf = config; - const files = await readdir('.', { withFileTypes: true}); + const files = readdirSync('.', { withFileTypes: true}); for (const file of files) { if (file.isDirectory()) { try { - await stat(file.name + '/js/app.ts'); + statSync(file.name + '/js/app.ts'); config.input[file.name + '/js/app'] = file.name + '/js/app.ts'; } catch (e) { try { - await stat(file.name + '/js/app.js'); + statSync(file.name + '/js/app.js'); config.input[file.name + '/js/app.min'] = file.name + '/js/app.js'; } catch (e) {