File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/plugin-react-swc/src Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ type Options = {
47
47
* @default undefined
48
48
*/
49
49
plugins ?: [ string , Record < string , any > ] [ ]
50
+ /**
51
+ * Specify the location where SWC stores its intermediate cache files.
52
+ * @default '.swc'
53
+ */
54
+ swcCacheDir ?: string
50
55
/**
51
56
* Set the target for SWC in dev. This can avoid to down-transpile private class method for example.
52
57
* For production target, see https://vite.dev/config/build-options.html#build-target
@@ -88,6 +93,7 @@ const react = (_options?: Options): PluginOption[] => {
88
93
const options = {
89
94
jsxImportSource : _options ?. jsxImportSource ?? 'react' ,
90
95
tsDecorators : _options ?. tsDecorators ,
96
+ swcCacheDir : _options ?. swcCacheDir ,
91
97
plugins : _options ?. plugins
92
98
? _options ?. plugins . map ( ( el ) : typeof el => [ resolve ( el [ 0 ] ) , el [ 1 ] ] )
93
99
: undefined ,
@@ -264,7 +270,7 @@ const transformWithOptions = async (
264
270
jsc : {
265
271
target,
266
272
parser,
267
- experimental : { plugins : options . plugins } ,
273
+ experimental : { plugins : options . plugins , cacheRoot : options . swcCacheDir } ,
268
274
transform : {
269
275
useDefineForClassFields : true ,
270
276
react : reactConfig ,
You can’t perform that action at this time.
0 commit comments