File tree Expand file tree Collapse file tree 5 files changed +20
-45
lines changed Expand file tree Collapse file tree 5 files changed +20
-45
lines changed Original file line number Diff line number Diff line change 39
39
"react-router" : " ^7.3.0" ,
40
40
"react-transition-group" : " ^4.4.5" ,
41
41
"tsx" : " ^4.19.3" ,
42
- "vite" : " ^6.2.2" ,
43
- "vite-plugin-replace" : " ^0.1.1"
42
+ "vite" : " ^6.2.2"
44
43
}
45
44
}
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from 'vite' ;
2
2
import react from '@vitejs/plugin-react' ;
3
- import { replaceCodePlugin } from 'vite-plugin-replace' ;
4
3
5
4
export default defineConfig ( {
6
5
build : {
7
6
outDir : 'build' ,
8
7
} ,
9
8
plugins : [
10
9
react ( ) ,
11
- replaceCodePlugin ( {
12
- replacements : [
13
- {
14
- from : '__RELEASE_INFO__' ,
15
- to : 'MTU5NjMxOTIwMDAwMA==' , // 2020-08-02
16
- } ,
17
- {
18
- from : 'DISABLE_CHANCE_RANDOM' ,
19
- to : JSON . stringify ( true ) ,
20
- } ,
21
- ] ,
22
- } ) ,
10
+ {
11
+ name : 'replace-code' ,
12
+ enforce : 'post' ,
13
+ async transform ( code ) {
14
+ return code
15
+ . replaceAll ( '__RELEASE_INFO__' , 'MTU5NjMxOTIwMDAwMA==' ) // 2020-08-02
16
+ . replaceAll ( 'DISABLE_CHANCE_RANDOM' , 'true' )
17
+ } ,
18
+ } ,
23
19
] ,
24
20
} ) ;
Original file line number Diff line number Diff line change 41
41
"react-router" : " ^7.3.0" ,
42
42
"react-transition-group" : " ^4.4.5" ,
43
43
"tsx" : " ^4.19.3" ,
44
- "vite" : " ^6.2.2" ,
45
- "vite-plugin-replace" : " ^0.1.1"
44
+ "vite" : " ^6.2.2"
46
45
}
47
46
}
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import url from 'url';
2
2
import path from 'path' ;
3
3
import { defineConfig , transformWithEsbuild } from 'vite' ;
4
4
import react from '@vitejs/plugin-react' ;
5
- import { replaceCodePlugin } from 'vite-plugin-replace' ;
6
5
7
6
const currentDirectory = url . fileURLToPath ( new URL ( '.' , import . meta. url ) ) ;
8
7
@@ -24,18 +23,15 @@ export default defineConfig({
24
23
} ,
25
24
plugins : [
26
25
react ( ) ,
27
- replaceCodePlugin ( {
28
- replacements : [
29
- {
30
- from : '__RELEASE_INFO__' ,
31
- to : 'MTU5NjMxOTIwMDAwMA==' , // 2020-08-02
32
- } ,
33
- {
34
- from : 'DISABLE_CHANCE_RANDOM' ,
35
- to : JSON . stringify ( true ) ,
36
- } ,
37
- ] ,
38
- } ) ,
26
+ {
27
+ name : 'replace-code' ,
28
+ enforce : 'post' ,
29
+ async transform ( code ) {
30
+ return code
31
+ . replaceAll ( '__RELEASE_INFO__' , 'MTU5NjMxOTIwMDAwMA==' ) // 2020-08-02
32
+ . replaceAll ( 'DISABLE_CHANCE_RANDOM' , 'true' )
33
+ } ,
34
+ } ,
39
35
{
40
36
name : 'js-files-as-jsx' ,
41
37
enforce : 'pre' ,
You can’t perform that action at this time.
0 commit comments