Angular

Converting an Angular.js app from Require.js to Webpack

I’ve recently converted my webapp at work from Require.js to webpack, and although the initial setup was a little tricky, it clearly offers numerous benefits to make the switch when it comes to performance, loading times, and development workflow. In this post, I will only cover a basic switch from Require.js to Webpack. In a following post, I’ll go into lazy-loading with webpack and ui-router. Possible Require.js setups, and their pitfalls In essence, there are two basic setups you can have for your Require.
Read more

Karma tests with AngularJS + RequireJS

Setting up testing is usually a little painful – but setting up testing when you’re using some kind of weird Angular + Require setup is even worse! Furthermore, the Karma documentation is a little bit terse, so it’s hard to tell exactly what combination of configuration settings will get you your intended result. Here’s how I accomplished this. File Hierarchy Here is a typical, sample hierarchy. My top-level directory is something like /opt/some-app.
Read more