从NPM(节点模块)解析nunjucks模板?

时间:2018-08-20 15:13:08

标签: javascript html node.js npm nunjucks

寻找一种方法来获取nunjucks导入/包含文件,以从NPM node_modules文件夹中进行解析。

例如,假设我们安装了这样的软件包:

npm i -S @example/cards

我们现在要在模板中像这样从中导入

{% import "@example/templates/birthday.html" as birthday %}

有想法吗?

1 个答案:

答案 0 :(得分:0)

这可以解决问题,正如@Aikon Mogwai指出的那样:

export const AppShell: React.SFC<Props> = withStyles(styles)<Props>((props: Props) => (
  …
));

如果有人想要参考实现,我会在@superflycss/cli中实现它。

相关问题