我需要导入hbs才能使用partials,但是import * as hbs from "hbs"
不行,我用的是nest.js
错误:找不到部分标头
我的代码:
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.setBaseViewsDir(join(__dirname, "..", "views"));
app.setViewEngine("hbs");
hbs.registerPartials(__dirname + "/views/partials");
await app.listen(parseInt(process.env.PORT, 10) || 3000);
}