feat(org-chart): add core cards and fixed-layout integration
This commit is contained in:
1 parent
d18e3c3380
commit
61c6f8d1f1
161 files changed
+13044
-1
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import { build } from 'vite';
|
||||
import { readFile, writeFile } from 'node:fs/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { createRequire } from 'node:module';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import path from 'node:path';
|
||||
|
||||
const root = fileURLToPath(new URL('./', import.meta.url));
|
||||
const require = createRequire(import.meta.url);
|
||||
const manifest = JSON.parse(await readFile(path.join(root, 'package.json'), 'utf8'));
|
||||
const externals = Object.keys({ ...manifest.dependencies, ...manifest.peerDependencies });
|
||||
|
||||
await build({
|
||||
configFile: false,
|
||||
root,
|
||||
publicDir: false,
|
||||
build: {
|
||||
target: 'es2022',
|
||||
outDir: 'dist',
|
||||
minify: false,
|
||||
lib: { entry: path.join(root, 'src/index.ts'), formats: ['es'], fileName: () => 'index.js' },
|
||||
rolldownOptions: {
|
||||
external: id => externals.some(dependency => id === dependency || id.startsWith(`${dependency}/`)),
|
||||
onwarn(warning, warn) {
|
||||
// Restore the client boundary on the final public entry below.
|
||||
if (warning.code === 'MODULE_LEVEL_DIRECTIVE') return;
|
||||
warn(warning);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const typescriptManifest = require.resolve('typescript/package.json');
|
||||
const typescript = JSON.parse(await readFile(typescriptManifest, 'utf8'));
|
||||
execFileSync(process.execPath, [
|
||||
path.resolve(path.dirname(typescriptManifest), typescript.bin.tsc),
|
||||
'-p', path.join(root, 'tsconfig.build.json'),
|
||||
], { stdio: 'inherit' });
|
||||
|
||||
const entry = path.join(root, 'dist/index.js');
|
||||
await writeFile(entry, `"use client";\n${await readFile(entry, 'utf8')}`);
|
||||
Reference in new issue
Block a user