I recently moved Angular project to Webpack build system. After struggling with Angular Dependency Injection issues in JS source code, now that JS errors start occurring in CSS files. And I am totally confused why JS errors are targeting to a CSS file.
The error says;
Uncaught Error: [$injector:unpr] Unknown provider: eProvider <- e
And it occurs on every css file which is tarting with /*!. Also Same error start occurring on different css styles. e.g.
Can someone guide me how such JS injector errors occurring in CSS files?
My webpack config for CSS files are;
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
use: [
{ loader: 'css-loader',
options: {
modules: false,
sourceMap: true}
}}
],
fallback: 'style-loader'
})
},
I a requiring all css files together in entry file by;
function requireAll(requireContext) {
return requireContext.keys().map(requireContext);
}
requireAll(require.context('./../assets/css/', true, /\.css$/));
Can someone guide what's wrong in above config.
Update:
I solved first error on comments of the files by adding minimize: { discardComments: { removeAll: true } into css-loader options. But second issue in styles still persist.
