Add svelte as a view engine to swaf #33

Merged
ashpie merged 97 commits from svelte into develop 2021-11-09 19:31:22 +01:00
Showing only changes of commit c36e4c0fbe - Show all commits

View File

@ -21,7 +21,7 @@ export default abstract class ViewEngine extends AssetPreCompiler {
public setup(app: Express, main: boolean): void {
app.engine(this.extension, (path, options, callback) => {
// Props (locals)
const locals = Object.assign(options, this.getGlobals().get());
const locals = Object.assign(this.getGlobals().get(), options);
this.render(path, locals)
.then(value => callback(null, value))