【发布时间】:2020-02-25 14:00:06
【问题描述】:
我在 Gatsby 中使用 Snipcart 插件,但脚本会随处加载。是否可以通过某种功能仅在 1 个特定页面上触发脚本而不是完全触发?
以下是我在 Gatsby-config.js 文件中使用的选项
{
resolve: "gatsby-plugin-snipcart",
options: {
apiKey: process.env.SNIPCART_API,
autopop: true,
js: "https://cdn.snipcart.com/themes/v3.0.8/default/snipcart.js",
styles: "https://cdn.snipcart.com/themes/v3.0.8/default/snipcart.css",
jquery: false,
},
},
【问题讨论】:
标签: reactjs gatsby jamstack snipcart