From 4065a65fe3294e0ddf54f5756380f7dc1aa032b2 Mon Sep 17 00:00:00 2001 From: Maksymilian Pamula Date: Wed, 22 Apr 2020 06:46:36 +0200 Subject: TD: Rewrite application to TS --- plugins/base/search-component/webpack.config.js | 30 +++++++++++++------------ 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'plugins/base/search-component/webpack.config.js') diff --git a/plugins/base/search-component/webpack.config.js b/plugins/base/search-component/webpack.config.js index a7b503b6..559f5792 100644 --- a/plugins/base/search-component/webpack.config.js +++ b/plugins/base/search-component/webpack.config.js @@ -13,9 +13,10 @@ ringUiWebpackConfig.loaders.svgInlineLoader.include.push( ); const webpackConfig = () => ({ - entry: `${componentsPath}/app.js`, + entry: `${componentsPath}/root.tsx`, resolve: { mainFields: ['module', 'browser', 'main'], + extensions: ['.tsx', '.ts', '.js'], alias: { react: resolve('./node_modules/react'), 'react-dom': resolve('./node_modules/react-dom'), @@ -32,24 +33,25 @@ const webpackConfig = () => ({ rules: [ ...ringUiWebpackConfig.config.module.rules, { - test: /\.css$/, - include: componentsPath, + test: /\.s[ac]ss$/i, use: [ 'style-loader', - {loader: 'css-loader'}, - {loader: 'postcss-loader'} - ] - }, - { - test: /\.css$/, - include: /node_modules/, + 'css-loader', + 'sass-loader', + ], + include: componentsPath, exclude: ringUiWebpackConfig.componentsPath, - use: ['style-loader', 'css-loader'] }, { - test: /\.js$/, - include: [componentsPath], - loader: 'babel-loader?cacheDirectory' + test: /\.tsx?$/, + use: [ + { + loader: 'ts-loader', + options: { + transpileOnly: true + } + } + ] } ] }, -- cgit