File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,8 @@ export class TestExecutionService implements ITestExecutionService {
208208 }
209209
210210 karmaConfig . projectDir = projectData . projectDir ;
211+ karmaConfig . bundle = this . $options . bundle ;
212+ karmaConfig . platform = platform . toLowerCase ( ) ;
211213 this . $logger . debug ( JSON . stringify ( karmaConfig , null , 4 ) ) ;
212214
213215 return karmaConfig ;
Original file line number Diff line number Diff line change 11module . exports = function ( config ) {
2- config . set ( {
2+ const options = {
33
44 // base path that will be used to resolve all patterns (eg. files, exclude)
55 basePath : '' ,
@@ -73,5 +73,33 @@ module.exports = function(config) {
7373 // Continuous Integration mode
7474 // if true, Karma captures browsers, runs the tests and exits
7575 singleRun : false
76- } )
76+ } ;
77+
78+ setWebpackPreprocessor ( config , options ) ;
79+ setWebpack ( config , options ) ;
80+
81+ config . set ( options ) ;
82+ }
83+
84+ function setWebpackPreprocessor ( config , options ) {
85+ if ( config && config . bundle ) {
86+ if ( ! options . preprocessors ) {
87+ options . preprocessors = { } ;
88+ }
89+
90+ options . files . forEach ( file => {
91+ if ( ! options . preprocessors [ file ] ) {
92+ options . preprocessors [ file ] = [ ] ;
93+ }
94+ options . preprocessors [ file ] . push ( 'webpack' ) ;
95+ } ) ;
96+ }
97+ }
98+
99+ function setWebpack ( config , options ) {
100+ if ( config && config . bundle ) {
101+ const env = { } ;
102+ env [ config . platform ] = true ;
103+ options . webpack = require ( './webpack.config' ) ( env ) ;
104+ }
77105}
You can’t perform that action at this time.
0 commit comments