O'Reilly logo
  • Naman Sinha thinks this is interesting:

module: { loaders: [ // All files with a '.ts' or '.tsx' extension // will be handled by 'ts-loader'. { test: /\.tsx?$/, loader: "ts-loader" } ], preLoaders: [ // All output '.js' files will have any // sourcemaps re-processed by 'source-map-loader'. { test: /\.js$/, loader: "source-map-loader" } ] },

From

Cover of Mastering TypeScript - Second Edition

Note

There is a major change if using webpack v2. Example in this book uses webpack v1. See more.
Updated the highlighted line as
module: { rules: [ // All output '.js' files will have any // sourcemaps re-processed by 'source-map-loader'. { test: /\.tsx?$/, loader: "ts-loader" }, { test: /\.js$/, enforce: "pre", loader: "source-map-loader" } ] },