Alex Vovchuk
Alex Vovchuk

Reputation: 2926

Do I need loaders in Angular application?

Loaders can be used in Webpack configuration. It can be file-loader, html-loader, css-loader, json-loader, raw-loader, style-loader, to-string-loader, url-loader, awesome-typescript-loader.

Does Angular know about loaders without explicit Webpack configuration? Maybe it uses some internal ones under the hood?

Currently I have an Angular 6 enterprise application with all those loaders. But are they required? I mean that loaders should be attached using webpack.config.json. But I don't have any Webpack configuration in the project. Only short tsconfig.webpack.json, that configures more TS than Webpack. Can it be that - in my case - loaders are just redundant dependencies left after previous migrations?

Upvotes: 0

Views: 1058

Answers (1)

Austaras
Austaras

Reputation: 961

If you are using angular-cli then there are no need for them. angular-cli handles webpack configuration for you and bundled with every loader you will ever need so just remove them will be fine.

source

Upvotes: 1

Related Questions