File tree Expand file tree Collapse file tree 6 files changed +33
-12
lines changed Expand file tree Collapse file tree 6 files changed +33
-12
lines changed Original file line number Diff line number Diff line change 74
74
path : |
75
75
${{ env.yarn_cache }}
76
76
admin-js/node_modules
77
+ admin-js/yarn.lock
77
78
- name : Yarn install
78
79
if : steps.cache_node_modules.outputs.cache-hit != 'true'
79
- run : yarn install
80
+ run : yarn install --production
80
81
working-directory : admin-js/
81
82
- name : Cache output files
82
83
uses : actions/cache@v4
@@ -85,10 +86,10 @@ jobs:
85
86
key : yarn-${{ hashFiles('admin-js/src/*') }}-${{ hashFiles('admin-js/yarn.lock') }}
86
87
path : |
87
88
aiohttp_admin/static/admin.js
88
- aiohttp_admin/static/* .map
89
+ aiohttp_admin/static/admin.js .map
89
90
- name : Yarn build
90
91
if : steps.cache_admin_js.outputs.cache-hit != 'true'
91
- run : yarn build
92
+ run : yarn build --minify false
92
93
working-directory : admin-js/
93
94
94
95
test :
@@ -235,10 +236,10 @@ jobs:
235
236
- name : Install yarn
236
237
run : sudo apt install yarn -y
237
238
- name : Yarn install
238
- run : yarn install
239
+ run : yarn install --production
239
240
working-directory : admin-js/
240
241
- name : Yarn build
241
- run : yarn build
242
+ run : yarn build --production
242
243
working-directory : admin-js/
243
244
- name : Install dependencies
244
245
run :
Original file line number Diff line number Diff line change 6
6
"react" : " 18.2.0" ,
7
7
"react-admin" : " 4.16.7" ,
8
8
"react-dom" : " 18.2.0" ,
9
+ "terser" : " 5.40.0" ,
10
+ "vite" : " 6.2.6" ,
9
11
10
12
"create-react-admin" : " 4.16.7" ,
11
13
"ra-core" : " 4.16.7" ,
25
27
"ra-ui-materialui" : " 4.16.7"
26
28
},
27
29
"devDependencies" : {
30
+ "@babel/preset-env" : " 7.27.2" ,
31
+ "@babel/preset-react" : " 7.27.1" ,
28
32
"@testing-library/dom" : " 10.4.0" ,
29
33
"@testing-library/jest-dom" : " 6.6.3" ,
30
34
"@testing-library/react" : " 16.3.0" ,
31
35
"@testing-library/user-event" : " 14.6.1" ,
32
36
"@ungap/structured-clone" : " 1.3.0" ,
37
+ "jest" : " 29.7.0" ,
38
+ "jest-environment-jsdom" : " 29.7.0" ,
33
39
"jest-fail-on-console" : " 3.3.1" ,
34
- "react-scripts " : " 5.0.1 "
40
+ "whatwg-fetch " : " 3.6.20 "
35
41
},
36
42
"scripts" : {
37
- "start" : " react-scripts start" ,
38
- "build" : " react-scripts build && (rm ../aiohttp_admin/static/*.js.map || true) && mv build/static/js/main.*.js ../aiohttp_admin/static/admin.js && mv build/static/js/main.*.js.map ../aiohttp_admin/static/ && rm -rf build/" ,
39
- "test" : " jest" ,
40
- "eject" : " react-scripts eject"
43
+ "dev" : " vite" ,
44
+ "build" : " vite build" ,
45
+ "test" : " jest"
41
46
},
42
47
"eslintConfig" : {
43
48
"extends" : [
Original file line number Diff line number Diff line change @@ -449,9 +449,9 @@ const App = (props) => {
449
449
STATE = aiohttpState ;
450
450
const [ loaded , setLoaded ] = useState ( STATE [ "js_module" ] === null ) ;
451
451
if ( ! loaded ) {
452
- // The inline comment skips the webpack import() and allows us to use the native
452
+ // The inline comment skips the Vite import() and allows us to use the native
453
453
// browser's import() function. Needed to dynamically import a module.
454
- import ( /* webpackIgnore: true */ STATE [ "js_module" ] ) . then ( ( mod ) => {
454
+ import ( /* @vite -ignore */ STATE [ "js_module" ] ) . then ( ( mod ) => {
455
455
Object . assign ( COMPONENTS , mod . components ) ;
456
456
Object . assign ( FUNCTIONS , mod . functions ) ;
457
457
setLoaded ( true ) ;
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from "vite" ;
2
+
3
+ export default defineConfig ( {
4
+ build : {
5
+ minify : "terser" ,
6
+ outDir : "../aiohttp_admin/static/" ,
7
+ rollupOptions : {
8
+ input : "src/admin.jsx" ,
9
+ output : {
10
+ entryFileNames : "[name].js"
11
+ }
12
+ } ,
13
+ sourcemap : true ,
14
+ } ,
15
+ } )
You can’t perform that action at this time.
0 commit comments