File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,29 +32,25 @@ function ViteEjsPlugin(data: ViteEjsPluginDataType = {}, options?: ViteEjsPlugin
3232 transformIndexHtml : {
3333 enforce : "pre" ,
3434 transform ( html ) {
35- try {
36- if ( typeof data === "function" ) data = data ( config ) ;
37- let ejsOptions = options && options . ejs ? options . ejs : { } ;
38- if ( typeof ejsOptions === "function" ) ejsOptions = ejsOptions ( config ) ;
39-
40-
41- html = ejs . render (
42- html ,
43- {
44- NODE_ENV : config . mode ,
45- isDev : config . mode === "development" ,
46- ...data
47- } ,
48- {
49- // setting views enables includes support
50- views : [ config . root ] ,
51- ...ejsOptions ,
52- async : false // Force sync
53- }
54- ) ;
55- } catch ( e : any ) {
56- return e . message ;
57- }
35+ if ( typeof data === "function" ) data = data ( config ) ;
36+ let ejsOptions = options && options . ejs ? options . ejs : { } ;
37+ if ( typeof ejsOptions === "function" ) ejsOptions = ejsOptions ( config ) ;
38+
39+
40+ html = ejs . render (
41+ html ,
42+ {
43+ NODE_ENV : config . mode ,
44+ isDev : config . mode === "development" ,
45+ ...data
46+ } ,
47+ {
48+ // setting views enables includes support
49+ views : [ config . root ] ,
50+ ...ejsOptions ,
51+ async : false // Force sync
52+ }
53+ ) ;
5854
5955 return html ;
6056 }
You can’t perform that action at this time.
0 commit comments