-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from core-ds/feat/swc-loader
feat(*): add useSwc option
- Loading branch information
Showing
19 changed files
with
576 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
'arui-scripts': minor | ||
--- | ||
|
||
Добавляем возможность использовать swc для загрузки кода в webpack и jest. | ||
|
||
- Добавлена настройка `codeLoader` для выбора используемого загрузчика кода. | ||
Настройка заменяет собой уже существовавшую `useTscLoader` и добавляет возможность использовать в качестве | ||
загрузчика swc. | ||
Использование swc значительно ускоряет сборку (до 2 раз), без особых негативных последствий. | ||
|
||
- Добавлена настройка `jestCodeTransformer` для выбора обработчика кода для jest. | ||
Заменяет собой `jestUseTsJest` и добавляет возможность использовать `@swc/jest`. swc в jest немного меняет поведение при использовании | ||
spyOn для esm модулей. | ||
|
||
- Флаг `useTscLoader` помечен как deprecated и будет удален в следующем мажорном релизе. Используйте `codeLoader: 'tsc'`. | ||
- Флаг `jestUseTsJest` помечен как deprecated и будет удален в следующем мажорном релизе. Используйте `jestCodeTransformer: 'tsc'`. | ||
- Флаг `webpack4Compatibility` помечен как deprecated и будет удален в следующем мажорном релизе. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { Options } from '@swc/core'; | ||
|
||
import applyOverrides from './util/apply-overrides'; | ||
import { configs } from './app-configs'; | ||
|
||
const swcConfig: Options = { | ||
env: { coreJs: '3', mode: 'entry' }, | ||
jsc: { | ||
parser: { | ||
syntax: 'typescript', | ||
tsx: true, | ||
decorators: true, | ||
}, | ||
loose: true, | ||
transform: { | ||
legacyDecorator: true, | ||
react: { | ||
runtime: 'automatic', | ||
}, | ||
}, | ||
experimental: configs.collectCoverage | ||
? { | ||
plugins: [ | ||
['swc-plugin-coverage-instrument', {}], | ||
], | ||
} | ||
: {}, | ||
}, | ||
}; | ||
|
||
export const swcClientConfig = applyOverrides(['swc', 'swcClient'], swcConfig); | ||
|
||
export const swcServerConfig = applyOverrides(['swc', 'swcServer'], swcConfig); | ||
|
||
export const swcJestConfig = applyOverrides(['swc', 'swcJest'], swcConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.