fix: Fix plugins in build.

This commit is contained in:
Sam 2022-03-17 14:33:35 +02:00
parent 6f3a5021fb
commit ec8d5ca6ad
No known key found for this signature in database
GPG Key ID: D004126FCD1A6DF0
3 changed files with 6 additions and 4 deletions

View File

@ -66,7 +66,8 @@ async function generateDefaultTypesMap() {
await Promise.all(
defaultPackages.map(async (packageName) => {
const { default: types } = await import(`${packageName}/types`);
const version = packageFile.devDependencies[packageName];
const version =
packageFile.devDependencies[packageName] || packageFile.dependencies[packageName];
createPluginTypesMap({
packageTypes: types,
typesMap: defaultTypesMap,

View File

@ -19,7 +19,8 @@ import path from 'path';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import build, { createCustomPluginTypesMap } from '@lowdefy/build';
import build from '@lowdefy/build';
import createCustomPluginTypesMap from './createCustomPluginTypesMap.mjs';
const argv = yargs(hideBin(process.argv)).argv;

View File

@ -30,7 +30,7 @@ async function getPluginDefinitions({ directories }) {
return get(lowdefy, 'plugins', { default: [] });
}
async function createCustomTypesMap({ directories }) {
async function createCustomPluginTypesMap({ directories }) {
const customTypesMap = {
actions: {},
blocks: {},
@ -63,4 +63,4 @@ async function createCustomTypesMap({ directories }) {
return customTypesMap;
}
export default createCustomTypesMap;
export default createCustomPluginTypesMap;