0

I have tried adding bootstrap css to the install.json file the following way, but I got an error:

,
      {
        "type": "style",
        "src": "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
      }

How can I add it to the project and use it?

1 Answers1

0

I tested this in my install.json and it worked fine

 "resources": {
    "body": [
      {
        "type": "style",
        "src": "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
      },
      {
        "type": "style",
        "src": "./source/app.css"
      },
      {
        "type": "script",
        "src": "./source/app.js"
      }
    ]
  },

  "preview": {
    "handlers": [
      {
        "options": ["_default"],
        "execute": "INSTALL_SCOPE.setOptions(INSTALL_OPTIONS)"
      },
      {
        "options": ["_product"],
        "execute": "INSTALL_SCOPE.setProduct(INSTALL_PRODUCT)"
      }
    ]
  },
  "options": {}
}

There is likely something wrong with the JSON of your install.json. You could try copy and paste your install.json in this tool to test: https://www.cloudflare.com/apps/developer/install-json-tester

  • The install.json is valid but I get the following error on the preview section: An error occurred as we tried to bundle your apps to create a preview. Please – Amir Baruch Jun 29 '18 at 22:29
  • Are all the files present in the source file? I would try removing all the resources and one by one add them back in to see which one is breaking. You could also check out the output of console.log. This isn't an issue with boot strap though – Victoria Bernard Jul 05 '18 at 15:55