Skip to content

Collection of challenges offered by legacy angualrjs apps when moving to a modern tech stack (Webpack)

License

Notifications You must be signed in to change notification settings

Igonato/legacy-angularjs-app

 
 

Repository files navigation

Legacy AngularJS App

This "legacy" AngularJS project is a collection of tests/challenges for this angularjs webpack setup project.

Based on angular/angular-seed.

Challenges

Bower

Setup should work with bower

Tricky Bower Components

TODO: angular-moment, angualr-pdf

templateUrl Resolution

There is a good chance that templateUrls in a legacy project will not work with an angular-template-loader. Good news are that we can archive the same thing with more control using string-replace-loader:

{
    // Transform `templateUrl: 'url'` to `template: require('path')`, 
    // but skip for url values that startWith 'cache'
    loader: 'string-replace-loader',
    options: {
        search: /templateUrl\s*:\s*['"`](.*?)['"`]\s*([,}])/gm,
        replace: (match, url, ending) =>
            url.startsWith('cache') ? match :
            `template: require('foo/${ url }')${ ending }`,
    },
}

Preprocessors

For a good measure, let's ensure that there are support for common preprocessing languages/tools: Sass, Less, Stylus and Autoprefixer for styles and Pug for templates.

About

Collection of challenges offered by legacy angualrjs apps when moving to a modern tech stack (Webpack)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 47.7%
  • JavaScript 47.2%
  • CSS 5.1%