mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:17:00 +00:00
fix: build bug (#2685)
This commit is contained in:
parent
56d1d1b85f
commit
196bec0ede
@ -21,8 +21,9 @@ import { getDepPkgPath, getDepsConfig } from './utils/getDepsConfig';
|
||||
import { EsbuildSupportExts, globExcludeFiles } from './constant';
|
||||
import { PkgLog, UserConfig, getPackageJson } from './utils';
|
||||
|
||||
const serverGlobalFiles: string[] = ['src/**/*.{ts,js,tsx,jsx,mjs}', '!src/client/**', ...globExcludeFiles];
|
||||
const clientGlobalFiles: string[] = ['src/**/*.{ts,js,tsx,jsx,mjs}', '!src/server/**', ...globExcludeFiles];
|
||||
const validExts = ['.ts', '.tsx', '.js', '.jsx', '.mjs'];
|
||||
const serverGlobalFiles: string[] = ['src/**', '!src/client/**', ...globExcludeFiles];
|
||||
const clientGlobalFiles: string[] = ['src/**', '!src/server/**', ...globExcludeFiles];
|
||||
const sourceGlobalFiles: string[] = ['src/**/*.{ts,js,tsx,jsx,mjs}', '!src/**/__tests__'];
|
||||
|
||||
const external = [
|
||||
@ -155,7 +156,7 @@ export function writeExternalPackageVersion(cwd: string, log: PkgLog) {
|
||||
export async function buildServerDeps(cwd: string, serverFiles: string[], log: PkgLog) {
|
||||
log('build plugin server dependencies');
|
||||
const outDir = path.join(cwd, target_dir, 'node_modules');
|
||||
const serverFileSource = serverFiles.map((item) => fs.readFileSync(item, 'utf-8'));
|
||||
const serverFileSource = serverFiles.filter(item => validExts.includes(path.extname(item))).map((item) => fs.readFileSync(item, 'utf-8'));
|
||||
const sourcePackages = getSourcePackages(serverFileSource);
|
||||
const includePackages = getIncludePackages(sourcePackages, external, pluginPrefix);
|
||||
const excludePackages = getExcludePackages(sourcePackages, external, pluginPrefix);
|
||||
|
Loading…
Reference in New Issue
Block a user