finds.dev← search

// the find

TheLarkInn/angular2-template-loader

★ 206 · JavaScript · MIT · updated Jul 2020

Chain-to loader for webpack that inlines all html and style's in angular2 components.

A webpack loader that rewrites Angular component metadata — swapping `templateUrl` and `styleUrls` string literals into `require()` calls so webpack can bundle them. It was useful during the Angular 2 beta/RC era when the Angular CLI didn't exist yet. Today the CLI handles all of this out of the box.

Tiny, single-purpose implementation that's easy to audit — the entire logic is in one `index.js`. Has test fixtures covering edge cases like multiple styles, spacing, and URLs without leading `./`. The `keepUrl=true` option is a thoughtful escape hatch for file-loader workflows.

Dead project — last commit in 2020, targeting tooling patterns from 2016. The Angular CLI has made this entirely unnecessary; nobody setting up a new Angular project would reach for a custom webpack loader. Operates via regex on source text rather than a proper AST, so malformed or unusual decorator syntax will silently produce broken output. No TypeScript source, just a loose JS file with no type safety.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →