Setting up TypeScript + Webpack + Angular 1.4 + Angular 2 Router

270 views
Skip to first unread message

Mayur Dudhani

unread,
Nov 11, 2015, 1:39:00 PM11/11/15
to AngularJS
I would like to get some feedback on the above mentioned combination. 

Also, I would really like if someone could point to a guide/example/anything to how to setup TypeScript with webpack. I tried to setup but I just keep running into errors. 
One more question, it looks like I need to have maintain a ".d.ts" file for TypeScript and npm dependency for webpack. Is there a way where I can combine them together or make it easier to maintain dependencies? 

Kyle Cordes

unread,
Nov 11, 2015, 11:04:53 PM11/11/15
to AngularJS

I know I have seen examples like this around the Internet. I have one under development here, but it will be at least a few more weeks before we get it published in full. But I can find a fragment for you and paste it below. This is a webpack config - it works, we have already used it in a Angular 2 class. Hopefully it helps.

module.exports = {
  context: __dirname + "/www",
  entry: "./app/app",
  output: {
    path: __dirname + "/www", filename: "bundle.js"
  },
  resolve: {
    extensions: ['', '.js', '.ts']
  },
  module: {
    loaders: [{
      test: /\.ts/, loaders: ['ts-loader'], exclude: /node_modules/
    }]
  }
};

Kyle

 

Mayur Dudhani

unread,
Nov 12, 2015, 12:23:18 PM11/12/15
to AngularJS
Thanks Kyle. 
I have something similar setup, but I am finding it hard to maintain the dependencies. I have to keep updating the ".d.ts" file also installing node modules and was wondering if there was an easier way to do things. 

rajeev kumar

unread,
Oct 17, 2016, 7:49:43 AM10/17/16
to AngularJS
HI ,

Can you you help me ? how to use d.ts and handle build with webpack

Mayur Dudhani

unread,
Oct 18, 2016, 1:26:57 PM10/18/16
to ang...@googlegroups.com
Hello,

Sorry, I won't be able to help you as I did not set up with typescript. 
Good luck.

Have a nice day!

Thank you and Regards,
Mayur Dudhani

--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/CthOq0Fdofw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+unsubscribe@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages