Skip to content

Commit f98adf0

Browse files
committed
Stop catching errors on compiling ejs files
1 parent ffb9e77 commit f98adf0

1 file changed

Lines changed: 19 additions & 23 deletions

File tree

index.ts

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)