UNPKG

1.95 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.COMMON_TARGET_DESCRIPTOR_SCHEMA = exports.DESCRIPTOR_SCHEMA = exports.ENGINES_SCHEMA = void 0;
7const ENGINES_SCHEMA = {
8 type: 'object',
9 properties: {
10 browsers: {
11 oneOf: [{
12 type: 'array',
13 items: {
14 type: 'string'
15 }
16 }, {
17 type: 'string'
18 }]
19 }
20 },
21 __forbiddenProperties: ['browser'],
22 additionalProperties: {
23 type: 'string'
24 }
25};
26exports.ENGINES_SCHEMA = ENGINES_SCHEMA;
27const DESCRIPTOR_SCHEMA = {
28 type: 'object',
29 properties: {
30 context: {
31 type: 'string',
32 enum: ['node', 'browser', 'web-worker', 'electron-main', 'electron-renderer']
33 },
34 includeNodeModules: {
35 oneOf: [{
36 type: 'boolean'
37 }, {
38 type: 'array',
39 items: {
40 type: 'string',
41 __type: 'a wildcard or filepath'
42 }
43 }, {
44 type: 'object',
45 properties: {},
46 additionalProperties: {
47 type: 'boolean'
48 }
49 }]
50 },
51 outputFormat: {
52 type: 'string',
53 enum: ['global', 'esmodule', 'commonjs']
54 },
55 distDir: {
56 type: 'string'
57 },
58 publicUrl: {
59 type: 'string'
60 },
61 isLibrary: {
62 type: 'boolean'
63 },
64 sourceMap: {
65 oneOf: [{
66 type: 'boolean'
67 }, {
68 type: 'object',
69 properties: {
70 inlineSources: {
71 type: 'boolean'
72 },
73 sourceRoot: {
74 type: 'string'
75 },
76 inline: {
77 type: 'boolean'
78 }
79 },
80 additionalProperties: false
81 }]
82 },
83 engines: ENGINES_SCHEMA
84 },
85 additionalProperties: false
86};
87exports.DESCRIPTOR_SCHEMA = DESCRIPTOR_SCHEMA;
88const COMMON_TARGET_DESCRIPTOR_SCHEMA = {
89 oneOf: [DESCRIPTOR_SCHEMA, {
90 enum: [false]
91 }]
92};
93exports.COMMON_TARGET_DESCRIPTOR_SCHEMA = COMMON_TARGET_DESCRIPTOR_SCHEMA;
\No newline at end of file