File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ class ScratchWebpackConfigBuilder {
3535 const isProduction = process . env . NODE_ENV === 'production' ;
3636 const mode = isProduction ? 'production' : 'development' ;
3737
38+ this . _libraryName = libraryName ;
3839 this . _rootPath = toPath ( rootPath ) || '.' ; // '.' will cause a webpack error since src must be absolute
3940 this . _srcPath = toPath ( srcPath ) ?? path . resolve ( this . _rootPath , 'src' ) ;
4041 this . _distPath = toPath ( distPath ) ?? path . resolve ( this . _rootPath , 'dist' ) ;
@@ -77,6 +78,18 @@ class ScratchWebpackConfigBuilder {
7778 } ;
7879 }
7980
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+
8093 /**
8194 * @returns {Configuration } a copy of the current configuration object.
8295 */
You can’t perform that action at this time.
0 commit comments