1

How can I modify my .ts webpack loader so that instead of having a single main.[hash].js file with my app's code I can have a .js file for each .ts file?

Right now this is my webpack loader to handle .ts files:

  output: {
   filename: '[name].[hash].js',
  },
  resolve: {
   extensions: ['', '.ts', '.js', '.json']
  },
  module: {
   loaders: [
   {
    test: /\.ts$/,
    exclude: [
      './node_modules'
    ],
    loaders: ['awesome-typescript-loader', 'angular2-template-loader']
  },

Thanks.

Edit: I'm actually looking to be able to search .ts files using google developers tools

ilovelamp
  • 739
  • 3
  • 9
  • 20

2 Answers2

0

The point of webpack is specifically to bundle and minty all your typescript into a single file. You don't want that, you can use gulp or some other task runner to just compile the TypeScript.

Ben Richards
  • 3,437
  • 1
  • 14
  • 18
0

Got it, I just needed to add this option

module.exports = {
 devtool: 'source-map',

I should mention that I was actually looking to be able to search .ts files using google developers console and this does it.

ilovelamp
  • 739
  • 3
  • 9
  • 20