File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ class ScratchWebpackConfigBuilder {
35
35
const isProduction = process . env . NODE_ENV === 'production' ;
36
36
const mode = isProduction ? 'production' : 'development' ;
37
37
38
+ this . _libraryName = libraryName ;
38
39
this . _rootPath = toPath ( rootPath ) || '.' ; // '.' will cause a webpack error since src must be absolute
39
40
this . _srcPath = toPath ( srcPath ) ?? path . resolve ( this . _rootPath , 'src' ) ;
40
41
this . _distPath = toPath ( distPath ) ?? path . resolve ( this . _rootPath , 'dist' ) ;
@@ -77,6 +78,18 @@ class ScratchWebpackConfigBuilder {
77
78
} ;
78
79
}
79
80
81
+ /**
82
+ * @returns {ScratchWebpackConfigBuilder } a copy of the current configuration builder.
83
+ */
84
+ clone ( ) {
85
+ return new ScratchWebpackConfigBuilder ( {
86
+ libraryName : this . _libraryName ,
87
+ rootPath : this . _rootPath ,
88
+ srcPath : this . _srcPath ,
89
+ distPath : this . _distPath
90
+ } ) . merge ( this . _config ) ;
91
+ }
92
+
80
93
/**
81
94
* @returns {Configuration } a copy of the current configuration object.
82
95
*/
You can’t perform that action at this time.
0 commit comments