angular2-template-loader icon indicating copy to clipboard operation
angular2-template-loader copied to clipboard

Angular2-template-loader does not work with awesome-typescript-loader in my tests

Open gituser7878-Ultralinq opened this issue 8 years ago • 4 comments

EDIT (Nov 1, 2016): template: require('./myComponent.html') was necessary for me to use with awesome-typescript-loader, which defeated the point since templateURL should be working and converted to in-line on the fly. templateUrl didn't work even with a hardcoded path. However no issues with ts-loader so my problem was solved.

Here is some of my webpack.test.js configuration:

module: {
    loaders: [
        {
            test: /\.ts$/,
            loaders: ['awesome-typescript-loader', 'angular2-template-loader']
        },
        {
            test: /\.html$/,
            loader: 'raw-loader'

        }

] }

gituser7878-Ultralinq avatar Sep 22 '16 14:09 gituser7878-Ultralinq

I would accept a PR for having the loader accept an option in the config that doesn't transform the templateUrl, etc.

TheLarkInn avatar Oct 14 '16 01:10 TheLarkInn

Well this did finally work for me with ts-loader. Not awesome-typescript-loader.

gituser7878-Ultralinq avatar Nov 01 '16 19:11 gituser7878-Ultralinq

Hi @TheLarkInn, I just implemented this feature using a keepUrl option and here's the PR: https://github.com/TheLarkInn/angular2-template-loader/pull/39

But I'm still not satisfied with it's name :) any better ideas?

Thanks!

yjaaidi avatar Nov 06 '16 10:11 yjaaidi

i tried to adjust the loader order like #19 , also works for tests

tekix avatar Nov 08 '16 15:11 tekix