@@ -157,7 +157,15 @@ class JsonWebpackSerializer {
157
157
}
158
158
159
159
private _concatPlugin ( plugin : any ) {
160
- return plugin . settings ;
160
+ const options = plugin . settings ;
161
+ if ( ! options || ! options . filesToConcat ) {
162
+ return options ;
163
+ }
164
+
165
+ const filesToConcat = options . filesToConcat
166
+ . map ( ( file : string ) => path . relative ( process . cwd ( ) , file ) ) ;
167
+
168
+ return { ...options , filesToConcat } ;
161
169
}
162
170
163
171
private _uglifyjsPlugin ( plugin : any ) {
@@ -253,7 +261,14 @@ class JsonWebpackSerializer {
253
261
} else if ( plugin [ 'copyWebpackPluginPatterns' ] ) {
254
262
// CopyWebpackPlugin doesn't have a constructor nor save args.
255
263
this . variableImports [ 'copy-webpack-plugin' ] = 'CopyWebpackPlugin' ;
256
- const patternsSerialized = serializer ( plugin [ 'copyWebpackPluginPatterns' ] ) ;
264
+ const patternOptions = plugin [ 'copyWebpackPluginPatterns' ] . map ( ( pattern : any ) => {
265
+ if ( ! pattern . context ) {
266
+ return pattern ;
267
+ }
268
+ const context = path . relative ( process . cwd ( ) , pattern . context ) ;
269
+ return { ...pattern , context } ;
270
+ } ) ;
271
+ const patternsSerialized = serializer ( patternOptions ) ;
257
272
const optionsSerialized = serializer ( plugin [ 'copyWebpackPluginOptions' ] ) || 'undefined' ;
258
273
return `\uFF02CopyWebpackPlugin(${ patternsSerialized } , ${ optionsSerialized } )\uFF02` ;
259
274
}
0 commit comments