File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -195,8 +195,27 @@ and replace `react-scripts` in `package.json`:
195195
196196See also experimental [ autoscan] ( https://github.com/oklas/react-app-alias/issues/70 ) feature
197197
198+ ### Using SWC etc
198199
199- #### API
200+ Plugin SWC must be declared in plugin section before alias plugn. This is because
201+ SWC plugn recreate SWC configuration instead of babel configuration. Both babel and
202+ swc configurations originally without alias configuration. So to configure alias,
203+ alias plugin must be aplied after SWC plugin:
204+
205+ ``` js
206+ const { CracoAliasPlugin } = require (' react-app-alias' );
207+ const CracoSwcPlugin = require (' craco-swc' );
208+
209+ module .exports = {
210+ plugins: [
211+ { plugin: CracoSwcPlugin },
212+ { plugin: CracoAliasPlugin },
213+ ],
214+ }
215+ ```
216+
217+
218+ ### API
200219
201220* ** options**
202221
You can’t perform that action at this time.
0 commit comments