mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-04-07 23:20:02 +00:00
fix: build issues
This commit is contained in:
@@ -6,7 +6,21 @@ import {createGenerator} from 'ts-json-schema-generator';
|
||||
|
||||
export type SchemaConsumer = (this: PluginContext, schema: JSONSchema7) => Record<string, string | Buffer>;
|
||||
|
||||
export const jsonSchema: EsbuildPlugin = {
|
||||
/**
|
||||
* ESBuild Plugin for directly importing schemas
|
||||
*
|
||||
* Schemas will be bundled in the output, but because each schema is compiled individually,
|
||||
* the resulting output can be substantially bigger and take longer to compile.
|
||||
* @example
|
||||
* interface Foo {}
|
||||
* import {default as fooSchema} from 'schema:#Foo'
|
||||
* @example
|
||||
* // ./my-type.ts
|
||||
* interface Bar {}
|
||||
* // ./schema-consumer.ts
|
||||
* import {default as barSchema} from 'schema:./my-type.js#Bar'
|
||||
*/
|
||||
export const esbuildJsonSchemaPlugin: EsbuildPlugin = {
|
||||
name: 'json-schema',
|
||||
setup(build) {
|
||||
const fileRegex = /^schema:/;
|
||||
|
||||
Reference in New Issue
Block a user