NODE_MODULES Telegram 18
Как перестать страдать из-за обилия точек и сделать из
import * as actionCreators from '../../../../../store/actions';
вот это
import * as actionCreators from 'features/auth/store/actions';
?

Другими словами — настроить поддержку абсолютных путей.

1. tsconfig.json для TypeScript, jsconfig.json для JS:
"baseUrl": "./src"
2. webpack.config.js
resolve: {
modules: ['node_modules', srcPath]
}

где srcPath абсолютный путь до директории src.
3. package.json
"baseDir": "src"

Настройка автоимпортов в WebStorm:
File → Settings → Code Style → Typescript → Import → Use path relative to tsconfig.json
или для JS:
File → Settings → Code Style → JavaScript → Import → Use path relatives to the project
Если вдруг не заработало:
ПКМ на папке src → mark directory → as resource root

Vscode, atom, sublime дополнительной настройки не требуют.

#webpack #javascript #typescript #webstorm #import #autoimport #absolutepath



tgoop.com/node_modules/18
Create:
Last Update:

Как перестать страдать из-за обилия точек и сделать из
import * as actionCreators from '../../../../../store/actions';
вот это
import * as actionCreators from 'features/auth/store/actions';
?

Другими словами — настроить поддержку абсолютных путей.

1. tsconfig.json для TypeScript, jsconfig.json для JS:
"baseUrl": "./src"
2. webpack.config.js

resolve: {
modules: ['node_modules', srcPath]
}

где srcPath абсолютный путь до директории src.
3. package.json
"baseDir": "src"

Настройка автоимпортов в WebStorm:
File → Settings → Code Style → Typescript → Import → Use path relative to tsconfig.json
или для JS:
File → Settings → Code Style → JavaScript → Import → Use path relatives to the project
Если вдруг не заработало:
ПКМ на папке src → mark directory → as resource root

Vscode, atom, sublime дополнительной настройки не требуют.

#webpack #javascript #typescript #webstorm #import #autoimport #absolutepath

BY Заметки фронтендера


Share with your friend now:
tgoop.com/node_modules/18

View MORE
Open in Telegram


Telegram News

Date: |

Hashtags are a fast way to find the correct information on social media. To put your content out there, be sure to add hashtags to each post. We have two intelligent tips to give you: With the administration mulling over limiting access to doxxing groups, a prominent Telegram doxxing group apparently went on a "revenge spree." Add up to 50 administrators The initiatives announced by Perekopsky include monitoring the content in groups. According to the executive, posts identified as lacking context or as containing false information will be flagged as a potential source of disinformation. The content is then forwarded to Telegram's fact-checking channels for analysis and subsequent publication of verified information.
from us


Telegram Заметки фронтендера
FROM American