mirror of
https://github.com/certd/certd.git
synced 2026-05-16 05:07:32 +08:00
feat: 升级midway,支持esm
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import { join } from 'path';
|
||||
import { FlywayHistory } from 'midway-flyway-js/dist/entity';
|
||||
|
||||
import { MidwayConfig } from '@midwayjs/core';
|
||||
import { UserEntity } from '../modules/authority/entity/user';
|
||||
import { PipelineEntity } from '../modules/pipeline/entity/pipeline';
|
||||
import { join } from 'path';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
// const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
import { FlywayHistory } from '@certd/midway-flyway-js';
|
||||
import { UserEntity } from '../modules/authority/entity/user.js';
|
||||
import { PipelineEntity } from '../modules/pipeline/entity/pipeline.js';
|
||||
//import { logger } from '../utils/logger';
|
||||
// load .env file in process.cwd
|
||||
import { mergeConfig } from './loader';
|
||||
|
||||
import { mergeConfig } from './loader.js';
|
||||
const development = {
|
||||
keys: '',
|
||||
keys: '111',
|
||||
koa: {
|
||||
port: 7001,
|
||||
},
|
||||
@@ -51,14 +54,7 @@ const development = {
|
||||
logging: true,
|
||||
|
||||
// 配置实体模型 或者 entities: '/entity',
|
||||
entities: [
|
||||
'**/modules/*/entity/*.ts',
|
||||
'**/entity/*.js',
|
||||
'**/entity/*.d.ts',
|
||||
PipelineEntity,
|
||||
FlywayHistory,
|
||||
UserEntity,
|
||||
],
|
||||
entities: ['**/modules/*/entity/*.ts', '**/entity/*.js', '**/entity/*.d.ts', PipelineEntity, FlywayHistory, UserEntity],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -83,4 +79,5 @@ const development = {
|
||||
},
|
||||
} as MidwayConfig;
|
||||
mergeConfig(development, 'development');
|
||||
|
||||
export default development;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MidwayConfig } from '@midwayjs/core';
|
||||
import { mergeConfig } from './loader';
|
||||
import { mergeConfig } from './loader.js';
|
||||
|
||||
const preview = {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MidwayConfig } from '@midwayjs/core';
|
||||
import { mergeConfig } from './loader';
|
||||
import { mergeConfig } from './loader.js';
|
||||
|
||||
const production = {
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { MidwayConfig } from '@midwayjs/core';
|
||||
|
||||
export default {
|
||||
koa: {
|
||||
port: null,
|
||||
},
|
||||
} as MidwayConfig;
|
||||
@@ -1,8 +1,7 @@
|
||||
import path from 'path';
|
||||
import _ from 'lodash';
|
||||
|
||||
const yaml = require('js-yaml');
|
||||
const fs = require('fs');
|
||||
import * as _ from 'lodash-es';
|
||||
import yaml from 'js-yaml';
|
||||
import fs from 'fs';
|
||||
|
||||
function parseEnv(defaultConfig: any) {
|
||||
const config = {};
|
||||
|
||||
Reference in New Issue
Block a user