Skip to content

Commit

Permalink
fix(custom-webpack): specify possible types of customWebpackConfig va…
Browse files Browse the repository at this point in the history
…lues (#971)

Co-authored-by: JeB <[email protected]>
  • Loading branch information
juristr and just-jeb authored May 2, 2021
1 parent 6aa384b commit 01f5427
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
30 changes: 20 additions & 10 deletions packages/custom-webpack/e2e/custom-webpack-config-schema.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
export const customWebpackConfig = {
type: 'object',
description: 'Custom webpack configuration',
properties: {
path: { type: 'string', description: 'Path to the custom webpack configuration file' },
mergeRules: {
default: false,
oneOf: [
{
type: 'object',
description:
'Merge rules as described here: https://github.com/survivejs/webpack-merge#mergewithrules',
properties: {
path: {
type: 'string',
description: 'Path to the custom webpack configuration file',
},
mergeRules: {
type: 'object',
description:
'Merge rules as described here: https://github.com/survivejs/webpack-merge#mergewithrules',
},
replaceDuplicatePlugins: {
type: 'boolean',
description: 'Flag that indicates whether to replace duplicate webpack plugins or not',
},
},
},
replaceDuplicatePlugins: {
{
type: 'boolean',
description: 'Flag that indicates whether to replace duplicate webpack plugins or not',
},
},
default: false,
],
};

export const indexTransform = {
Expand Down
35 changes: 27 additions & 8 deletions packages/custom-webpack/src/schema.ext.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
{
"properties": {
"customWebpackConfig": {
"type": "object",
"description": "Custom webpack configuration",
"properties": {
"path": {"type": "string", "description": "Path to the custom webpack configuration file"},
"mergeRules": {"type": "object", "description": "Merge rules as described here: https://github.com/survivejs/webpack-merge#mergewithrules"},
"replaceDuplicatePlugins": {"type": "boolean", "description": "Flag that indicates whether to replace duplicate webpack plugins or not"}
},
"default": false
"default": false,
"oneOf": [
{
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Path to the custom webpack configuration file"
},
"mergeRules": {
"type": "object",
"description": "Merge rules as described here: https://github.com/survivejs/webpack-merge#mergewithrules"
},
"replaceDuplicatePlugins": {
"type": "boolean",
"description": "Flag that indicates whether to replace duplicate webpack plugins or not"
}
}
},
{
"type": "boolean"
}
]
},
"indexTransform": {"type": "string", "description": "Path to the file with index.html transform function" }
"indexTransform": {
"type": "string",
"description": "Path to the file with index.html transform function"
}
}
}

0 comments on commit 01f5427

Please sign in to comment.