Тёмный

From CommonJS to ES modules (ESM) in TypeScript 

TypeScript TV with Benny
Подписаться 14 тыс.
Просмотров 8 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 8   
@TypeScriptTV
@TypeScriptTV Год назад
The main drawback of transitioning to ESM (ECMAScript Modules) at the moment is the inability of jest.mock to mock ES modules without Babel: github.com/jestjs/jest/issues/10025
@PatricSjoeoe
@PatricSjoeoe 8 месяцев назад
Recommend esmock and vitest instead.
@fluttterdev1k
@fluttterdev1k Год назад
thanks buddy that worked really well
@TypeScriptTV
@TypeScriptTV Год назад
I am glad to hear that. This week I will also add another video to my TypeScript series. Best regards, Benny.
@haiiry
@haiiry Год назад
One thing that bothers me about modules is .js extension inside the import statement of the TS file. Another is that the pure esm library is not compatible with commonjs project, so I have to use an older version or skip that library and use a different one.
@TypeScriptTV
@TypeScriptTV Год назад
Totally! There are also new file extensions (.cjs & .mjs) and differing behavior of the two module systems: nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs
@NiteeshKumarMahato
@NiteeshKumarMahato 4 месяца назад
How can we migrate an existing project with large codebase as I don't want to edit each and every file
@TypeScriptTV
@TypeScriptTV 4 месяца назад
Hey, the best way to do this is using ts2esm: github.com/bennycode/ts2esm
Далее
Require vs Import Javascript
22:39
Просмотров 79 тыс.
Mastering Modules in TypeScript [FULL COURSE]
18:28
Просмотров 5 тыс.
JAVASCRIPT: API Pagination
13:17
Просмотров 271
How to fix ERR_UNKNOWN_FILE_EXTENSION in #TypeScript
20:56
Import vs Require: The Biggest JavaScript Divide
4:03
Any, unknown, never, and void in TypeScript
10:18
Просмотров 3,8 тыс.
TypeScript: tsconfig demystified!
22:32
Просмотров 13 тыс.
Package JSON Demystified - The 'Exports' Keyword
14:46
Просмотров 3,8 тыс.
Start Using ES Modules Now
5:47
Просмотров 28 тыс.