@@ -10,21 +10,14 @@ import AutoImport from 'unplugin-auto-import/vite'
1010import Components from 'unplugin-vue-components/vite'
1111import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
1212
13- // 这里是服务器的地址
14- const CGI_PATH = '/cgi/ThirdParty/code.editor/api.cgi'
15- const FILE_PATH = '_api=read&path=/var/apps/code.editor/target/server/dist'
13+ const CGI_PATH = '/cgi/ThirdParty/code.editor/api.cgi/'
1614
1715export default defineConfig ( {
16+ base : CGI_PATH ,
17+
1818 build : {
1919 outDir : path . join ( __dirname , '../app/app/server/dist' ) ,
2020 emptyOutDir : true ,
21-
22- rollupOptions : {
23- output : {
24- manualChunks : undefined ,
25- inlineDynamicImports : true ,
26- } ,
27- } ,
2821 } ,
2922
3023 plugins : [
@@ -38,31 +31,6 @@ export default defineConfig({
3831 Components ( {
3932 resolvers : [ ElementPlusResolver ( ) ] ,
4033 } ) ,
41-
42- process . env . NODE_ENV === 'development'
43- ? undefined
44- : {
45- name : 'replace-file-loader' ,
46- transformIndexHtml ( html ) {
47- return html . replace ( / ( s r c | h r e f ) = " ( [ ^ " ] * \. ( j s | c s s | i c o ) ) " / g, ( match , attr , path ) => {
48- return `${ attr } ="${ CGI_PATH } ?${ FILE_PATH } ${ path } "`
49- } )
50- } ,
51- generateBundle ( _ , bundle ) {
52- Object . keys ( bundle ) . forEach ( ( fileName ) => {
53- const chunk = bundle [ fileName ] as any
54-
55- if ( fileName . endsWith ( '.css' ) ) {
56- chunk . source = chunk . source . replace (
57- / u r l \( \s * [ ' " ] ? ( \/ a s s e t s \/ [ ^ ' " ) ] * ) [ ' " ] ? \s * \) / g,
58- ( match : string , path : string ) => {
59- return match . replace ( path , `${ CGI_PATH } ?${ FILE_PATH } ${ path } ` )
60- } ,
61- )
62- }
63- } )
64- } ,
65- } ,
6634 ] ,
6735
6836 resolve : {
0 commit comments