File tree Expand file tree Collapse file tree 4 files changed +34
-17
lines changed Expand file tree Collapse file tree 4 files changed +34
-17
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,8 @@ const fs = require("fs");
33fs . existsSync = fs . existsSync || path . existsSync ;
44const interpret = require ( "interpret" ) ;
55const prepareOptions = require ( "./prepareOptions" ) ;
6- const webpackConfigurationSchema = require ( "../config/webpackConfigurationSchema.json" ) ;
7- const validateSchema = require ( "webpack" ) . validateSchema ;
86const findup = require ( "findup-sync" ) ;
7+ const validateOptions = require ( "./validate-options" ) ;
98
109module . exports = function ( ...args ) {
1110 const argv = args [ 1 ] || args [ 0 ] ;
@@ -136,21 +135,7 @@ module.exports = function(...args) {
136135
137136 function processConfiguredOptions ( options ) {
138137 if ( options ) {
139- let error ;
140- try {
141- const errors = validateSchema ( webpackConfigurationSchema , options ) ;
142- if ( errors && errors . length > 0 ) {
143- const { WebpackOptionsValidationError } = require ( "webpack" ) ;
144- error = new WebpackOptionsValidationError ( errors ) ;
145- }
146- } catch ( err ) {
147- error = err ;
148- }
149-
150- if ( error ) {
151- console . error ( error . message ) ;
152- process . exit ( - 1 ) ;
153- }
138+ validateOptions ( options ) ;
154139 } else {
155140 options = { } ;
156141 }
Original file line number Diff line number Diff line change 1+ const webpackConfigurationSchema = require ( "../config/webpackConfigurationSchema.json" ) ;
2+ const validateSchema = require ( "webpack" ) . validateSchema ;
3+
4+ module . exports = function validateOptions ( options ) {
5+ let error ;
6+ try {
7+ const errors = validateSchema ( webpackConfigurationSchema , options ) ;
8+ if ( errors && errors . length > 0 ) {
9+ const { WebpackOptionsValidationError } = require ( "webpack" ) ;
10+ error = new WebpackOptionsValidationError ( errors ) ;
11+ }
12+ } catch ( err ) {
13+ error = err ;
14+ }
15+
16+ if ( error ) {
17+ console . error ( error . message ) ;
18+ process . exit ( - 1 ) ;
19+ }
20+ } ;
Original file line number Diff line number Diff line change 143143 "babel-preset-jest" : " 24.6.0" ,
144144 "codecov" : " 3.5.0" ,
145145 "commitizen" : " 4.0.3" ,
146+ "commitlint" : " ^8.1.0" ,
146147 "commitlint-config-cz" : " 0.12.0" ,
147148 "conventional-changelog-cli" : " 2.0.21" ,
148149 "cz-customizable" : " 6.2.0" ,
You can’t perform that action at this time.
0 commit comments