From 5905f971a6af6dc78335dae6970db4cbba648660 Mon Sep 17 00:00:00 2001 From: Gordey Levchenko Date: Tue, 25 Feb 2020 23:56:33 +0600 Subject: [PATCH] Remove deprecated awesome loader from doc --- pages/Integrating with Build Tools.md | 4 --- pages/tutorials/Migrating from JavaScript.md | 34 ++++++++------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/pages/Integrating with Build Tools.md b/pages/Integrating with Build Tools.md index 135282048..63bad01d7 100644 --- a/pages/Integrating with Build Tools.md +++ b/pages/Integrating with Build Tools.md @@ -228,10 +228,6 @@ module.exports = { See [more details on ts-loader here](https://www.npmjs.com/package/ts-loader). -Alternatives: - -* [awesome-typescript-loader](https://www.npmjs.com/package/awesome-typescript-loader) - # MSBuild Update project file to include locally installed `Microsoft.TypeScript.Default.props` (at the top) and `Microsoft.TypeScript.targets` (at the bottom) files: diff --git a/pages/tutorials/Migrating from JavaScript.md b/pages/tutorials/Migrating from JavaScript.md index ccaf15e15..b837d391b 100644 --- a/pages/tutorials/Migrating from JavaScript.md +++ b/pages/tutorials/Migrating from JavaScript.md @@ -85,11 +85,11 @@ You can read more there. ## Webpack Webpack integration is pretty simple. -You can use `awesome-typescript-loader`, a TypeScript loader, combined with `source-map-loader` for easier debugging. +You can use `ts-loader`, a TypeScript loader. Simply run ```shell -npm install awesome-typescript-loader source-map-loader +npm install --save-dev ts-loader ``` and merge in options from the following into your `webpack.config.js` file: @@ -97,12 +97,6 @@ and merge in options from the following into your `webpack.config.js` file: ```js module.exports = { entry: "./src/index.ts", - output: { - filename: "./dist/bundle.js", - }, - - // Enable sourcemaps for debugging webpack's output. - devtool: "source-map", resolve: { // Add '.ts' and '.tsx' as resolvable extensions. @@ -110,26 +104,26 @@ module.exports = { }, module: { - loaders: [ - // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. - { test: /\.tsx?$/, loader: "awesome-typescript-loader" } + rules: [ + { + // // All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'. + test: /\.tsx?$/, + use: "ts-loader", + exclude: /node_modules/, + }, ], + }, - preLoaders: [ - // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. - { test: /\.js$/, loader: "source-map-loader" } - ] + output: { + filename: "bundle.js", + path: path.resolve(__dirname, "dist"), }, // Other options... }; ``` -It's important to note that awesome-typescript-loader will need to run before any other loader that deals with `.js` files. - -The same goes for [ts-loader](https://github.com/TypeStrong/ts-loader), another TypeScript loader for Webpack. -You can read more about the differences between the two [here](https://github.com/s-panferov/awesome-typescript-loader#differences-between-ts-loader). - +You can read more about ts-loader [here](https://github.com/TypeStrong/ts-loader). You can see an example of using Webpack in our [tutorial on React and Webpack](./React%20&%20Webpack.md). # Moving to TypeScript Files