From 7087c526efdaef4492cf18435718e98656b75a8e Mon Sep 17 00:00:00 2001 From: abhijithvijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Mon, 27 Jan 2020 19:40:13 +0530 Subject: [PATCH] feat: use awesome-typescript-loader for js, ts, tsx files --- webpack.config.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index fca8c28..2189f11 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,6 +7,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const WriteWebpackPlugin = require('write-webpack-plugin'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); +const { CheckerPlugin } = require('awesome-typescript-loader'); const ExtensionReloader = require('webpack-extension-reloader'); const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); @@ -66,22 +67,9 @@ module.exports = { module: { rules: [ { - test: /.(js|jsx)$/, - include: [path.resolve(__dirname, 'src/scripts')], - loader: 'babel-loader', - - options: { - plugins: ['syntax-dynamic-import'], - - presets: [ - [ - '@babel/preset-env', - { - modules: false, - }, - ], - ], - }, + test: /\.(js|ts|tsx)?$/, + loader: 'awesome-typescript-loader', + exclude: /node_modules/, }, { test: /\.scss$/, @@ -118,6 +106,8 @@ module.exports = { plugins: [ new webpack.ProgressPlugin(), + // for awesome-typescript-loader + new CheckerPlugin(), // https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/518 new FixStyleOnlyEntriesPlugin({ silent: true }), new webpack.EnvironmentPlugin(['NODE_ENV', 'TARGET_BROWSER']),