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 @@ -155,7 +155,15 @@ class JsonWebpackSerializer {
155155 }
156156
157157 private _concatPlugin ( plugin : any ) {
158- return plugin . settings ;
158+ const options = plugin . settings ;
159+ if ( ! options || ! options . filesToConcat ) {
160+ return options ;
161+ }
162+
163+ const filesToConcat = options . filesToConcat
164+ . map ( ( file : string ) => path . relative ( process . cwd ( ) , file ) ) ;
165+
166+ return { ...options , filesToConcat } ;
159167 }
160168
161169 private _pluginsReplacer ( plugins : any [ ] ) {
@@ -235,7 +243,14 @@ class JsonWebpackSerializer {
235243 } else if ( plugin [ 'copyWebpackPluginPatterns' ] ) {
236244 // CopyWebpackPlugin doesn't have a constructor nor save args.
237245 this . variableImports [ 'copy-webpack-plugin' ] = 'CopyWebpackPlugin' ;
238- const patternsSerialized = serializer ( plugin [ 'copyWebpackPluginPatterns' ] ) ;
246+ const patternOptions = plugin [ 'copyWebpackPluginPatterns' ] . map ( ( pattern : any ) => {
247+ if ( ! pattern . context ) {
248+ return pattern ;
249+ }
250+ const context = path . relative ( process . cwd ( ) , pattern . context ) ;
251+ return { ...pattern , context } ;
252+ } ) ;
253+ const patternsSerialized = serializer ( patternOptions ) ;
239254 const optionsSerialized = serializer ( plugin [ 'copyWebpackPluginOptions' ] ) || 'undefined' ;
240255 return `\uFF02CopyWebpackPlugin(${ patternsSerialized } , ${ optionsSerialized } )\uFF02` ;
241256 }
You can’t perform that action at this time.
0 commit comments