This "legacy" AngularJS project is a collection of tests/challenges for this angularjs webpack setup project.
Based on angular/angular-seed.
Setup should work with bower
TODO: angular-moment, angualr-pdf
There is a good chance that templateUrl
s 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 }`,
},
}
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.