PR-420915: Changing the logic for aliases for one source of truth on tsconfig.json and updating packages.

This commit is contained in:
2023-02-21 00:10:34 +00:00
parent 176636ea6b
commit 0bbe080ea0
15 changed files with 1279 additions and 1154 deletions

View File

@ -10,12 +10,14 @@ import { WebpackManifestPlugin } from 'webpack-manifest-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import ESLintPlugin from 'eslint-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
import { resolveTsAliases } from "resolve-ts-aliases";
const ROOT_DIR = path.resolve(__dirname);
const resolvePath = (...args) => path.resolve(ROOT_DIR, ...args);
const BUILD_DIR = resolvePath('build');
const { InjectManifest } = require('workbox-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const alias = resolveTsAliases(path.resolve("tsconfig.json"));
const copyPatterns = [
{
@ -50,11 +52,7 @@ const frontendConfig = {
},
resolve: {
extensions: ['.js', '.jsx','.ts','.tsx', '.json'],
alias: {
'@components': path.resolve(__dirname, 'src/frontend/components/'),
'@styles': path.resolve(__dirname, 'src/frontend/styles/'),
'@config': path.resolve(__dirname, 'config/'),
}
alias,
},
mode: 'production',
module: {
@ -160,11 +158,7 @@ const serverConfig = {
},
resolve: {
extensions: ['.js', '.jsx','.ts','.tsx', '.json'],
alias: {
'@components': path.resolve(__dirname, 'src/frontend/components/'),
'@styles': path.resolve(__dirname, 'src/frontend/styles/'),
'@config': path.resolve(__dirname, 'config/'),
}
alias,
},
mode: 'production',
module: {