Open ArtemEkzarho opened 6 years ago
@ArtemEkzarho Hi.
I put the follow code inside require.ensure
:
if (process.env.NODE_ENV == 'test') {
import('./foo.module');
} else {
require('./foo.module');
}
And inside webpack.config.karma.js
I put:
plugins: [
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('test') }
})
]
It's not good, but it was the way I got it =P
Problem in two different .configs). All want to build the application in one bundle, for tests and for production. This bundle will first be tested, and then deployed to env.
My solution does not solve the problem
https://github.com/ArtemEkzarho/setup_angular_lazyload_karma
Tests isn't running with lazy loaded module.
Can you help me?) Or all of this is no longer relevant?