javascript - 在 gatsby 构建之前运行 python 脚本

标签 javascript python gatsby

有没有办法配置 Gatsbyjs,以便在 Gatsby 中构建其他任何内容之前运行 python 脚本?

最佳答案

假设您使用 npm,您可以使用 npm-scripts在常见的 npm 命令之前和之后运行任意脚本。

在你的情况下,你可能会做类似的事情(未经测试):

"scripts": {
    "prestart": "python main.py",
    "start": "gatsby"
 },

关于javascript - 在 gatsby 构建之前运行 python 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61077153/

相关文章:

python - 确保县边界字典中的交换性/互惠性

python - 从字典列表中添加新列

python - 为 django 模型自动创建数据的工具

javascript - 网页包错误 : document is not defined

javascript - 在 GatsbyJs 中使用 React 汉堡菜单

javascript - 使用 Helm 向 Gatsby 添加脚本标签会引发语法错误

javascript - 为什么在 Firefox 中无法使用 JavaScript 拖动图像?

javascript - 有没有办法使用 VueJs 将列表分成几列?

javascript - PNaCI - 如何将消息从 index.html 发布到 PNaCI?

javascript - 在 Vue 中将 v-for 与嵌套对象一起使用