mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-24 14:11:29 +01:00
using sync versions to work with nodejs 12.x
nothing to gain from the async/promises version
This commit is contained in:
parent
1563337458
commit
812d0d91c0
@ -11,10 +11,9 @@
|
|||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import babel from '@babel/core';
|
import babel from '@babel/core';
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync, readdirSync, statSync } from "fs";
|
||||||
import rimraf from 'rimraf';
|
import rimraf from 'rimraf';
|
||||||
import { minify } from 'terser';
|
import { minify } from 'terser';
|
||||||
import { readdir,stat } from 'fs/promises';
|
|
||||||
import resolve from '@rollup/plugin-node-resolve';
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
|
||||||
// Best practice: use this
|
// Best practice: use this
|
||||||
@ -144,21 +143,21 @@ const config = {
|
|||||||
*
|
*
|
||||||
* @return Promise<object>
|
* @return Promise<object>
|
||||||
*/
|
*/
|
||||||
export default async function addAppsConfig()
|
export default function addAppsConfig()
|
||||||
{
|
{
|
||||||
const conf = config;
|
const conf = config;
|
||||||
const files = await readdir('.', { withFileTypes: true});
|
const files = readdirSync('.', { withFileTypes: true});
|
||||||
for (const file of files)
|
for (const file of files)
|
||||||
{
|
{
|
||||||
if (file.isDirectory())
|
if (file.isDirectory())
|
||||||
{
|
{
|
||||||
try {
|
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';
|
config.input[file.name + '/js/app'] = file.name + '/js/app.ts';
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
try {
|
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';
|
config.input[file.name + '/js/app.min'] = file.name + '/js/app.js';
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user