From 3fc1faff5f94f5a08bfdc4d0fed9dbe89629f869 Mon Sep 17 00:00:00 2001 From: MaxOvs19 Date: Tue, 30 May 2023 08:05:03 +0300 Subject: [PATCH] Fixed webpack common.js for imports project --- config/webpack/common.js | 12 +++++++++--- jsconfig.json | 11 ++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/config/webpack/common.js b/config/webpack/common.js index 2b99d678..dc5ebf52 100644 --- a/config/webpack/common.js +++ b/config/webpack/common.js @@ -52,10 +52,16 @@ module.exports = { resolve: { alias: { "@": `${paths.src}/modules`, - // "@components": `${paths.src}/components`, - // "@assets": `${paths.src}/assets`, + assets: `${paths.src}/assets`, + "@components": `${paths.src}/components`, + "@pages": `${paths.src}/pages`, + "@redux": `${paths.src}/redux`, + "@store": `${paths.src}/store`, + "@api": `${paths.src}/api`, + "@hooks": `${paths.src}/hooks`, }, - extensions: [".mjs", ".js", ".jsx", ".ts", ".tsx", ".json"], + // extensions: [".mjs", ".js", ".jsx", ".ts", ".tsx", ".json"], + extensions: [".jsx", "..."], }, experiments: { topLevelAwait: true, diff --git a/jsconfig.json b/jsconfig.json index ec2332eb..096a4df3 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,5 +1,14 @@ { "compilerOptions": { - "baseUrl": "src" + "baseUrl": "./src", + "paths": { + "assets/*": ["./assets/*"], + "@components/*": ["./components/*"], + "@pages/*": ["./pages/*"], + "@redux/*": ["./redux/*"], + "@store/*": ["./store/*"], + "@api/*": ["./api/*"], + "@hooks/*": ["./api/*"] + } } }