Skip to content

declaration: true #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nikolasleblanc opened this issue Aug 23, 2016 · 4 comments
Open

declaration: true #19

nikolasleblanc opened this issue Aug 23, 2016 · 4 comments

Comments

@nikolasleblanc
Copy link

Hey @TheLarkInn, trying to make a core component library in angular 2 that I can then bundle with webpack + awesome-typescript-loader + angular2-template-loader.

Because I'll be using this library in other angular2 projects, I need d.ts files, but for some reason, if I set declaration: true, angular2-template-loader stops doing its thing and my bundle keeps its templateUrls.

I've set useWebpackText: true.

@TheLarkInn
Copy link
Owner

This sounds like an issue with awesome-typescript-loader. My guess is that the loader does not use webpack's module resolution or loader chain and instead falls back to the default tsc. Does this sound right @s-panferov?

@tekix
Copy link

tekix commented Nov 8, 2016

moving angular2-template-loader before awesome-typescript-loader works for me when declaration:true

{
  test: /\.ts$/,
  loaders: ['angular2-template-loader', 'awesome-typescript-loader'],
  exclude: [/\.(spec|e2e)\.ts$/]
},

@nikolasleblanc
Copy link
Author

Wow, really? @TheLarkInn, does that even make sense? :)

On Tue, Nov 8, 2016 at 10:33 AM ryan [email protected] wrote:

moving angular2-template-loader before awesome-typescript-loader works
for me when declaration:true

{
test: /.ts$/,
loaders: ['angular2-template-loader', 'awesome-typescript-loader'],
exclude: [/.(spec|e2e).ts$/]
},


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#19 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB2ter4RSQZq-Z3nal55AQcH2Au62WZfks5q8JZdgaJpZM4Jqbbj
.

@VivekPMenon
Copy link

I have a similar situation. Creating an npm package for core components and distributing .js,.d.ts,html in my package along with the umd bundle. However when Consumer apps run webpack, it doesn't changes templateUrls of my core components to require statements obviously because these are .js files. I tried to chain angular2-template-loader with script-loader but no success.

Is there something i can do it to get it working or is there any fundamental issue in the way i am doing it. Any help would be really appreciated.

Riron added a commit to LuccaSA/lucca-ui that referenced this issue Nov 24, 2016
On utilise `declaration: true` dans tous les cas.

Ca posait actuellement un problème pour deux raisons:
- Export qui bugait dans main.ts
- Bug avec angular2-template-loader & awesome-typescript-loader (plus d'infos ici TheLarkInn/angular2-template-loader#19)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants