File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
packages/@angular/cli/tasks Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,15 @@ class JsonWebpackSerializer {
157157 }
158158
159159 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 } ;
161169 }
162170
163171 private _uglifyjsPlugin ( plugin : any ) {
@@ -253,7 +261,14 @@ class JsonWebpackSerializer {
253261 } else if ( plugin [ 'copyWebpackPluginPatterns' ] ) {
254262 // CopyWebpackPlugin doesn't have a constructor nor save args.
255263 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 ) ;
257272 const optionsSerialized = serializer ( plugin [ 'copyWebpackPluginOptions' ] ) || 'undefined' ;
258273 return `\uFF02CopyWebpackPlugin(${ patternsSerialized } , ${ optionsSerialized } )\uFF02` ;
259274 }
You can’t perform that action at this time.
0 commit comments