GoogleChrome / budget.json

Apache License 2.0
38 stars 23 forks source link

Support for [Options] #10

Open KorayTugberk-g opened 4 years ago

KorayTugberk-g commented 4 years ago

Hello,

Before two weeks, I have run a LightWallet test with a budget.json file. There was no error. After two weeks I have created a new test with the same file and it says

Runtime error encountered: Budget has unrecognized properties: [options]

My file is like below:

[
  {
    "path": "/*",
    "options": {
       "firstPartyHostnames": ["*.vava.cars"]
    },
    "timings": [
      {
        "metric": "interactive",
        "budget": 3500
      },
      {
        "metric": "first-meaningful-paint",
        "budget": 1000
      }
    ],
    "resourceSizes": [
      {
        "resourceType": "total",
        "budget": 1500
      },
      {
        "resourceType": "script",
        "budget": 100
      },
      {
        "resourceType":"stylesheet",
        "budget":200
      },
      {
        "resourceType":"image",
        "budget":10
      },
      {
        "resourceType":"third-party",
        "budget":250
      }
    ],
    "resourceCounts": [
      {
        "resourceType": "third-party",
        "budget": 3
      },
      {
        "resourceType":"stylesheet",
        "budget":2
      }
    ]
  },
  {
    "options": {
       "firstPartyHostnames": ["*.my-site.com", "my-site.cdn.com"]
    },
    "path": "/checkout",
    "resourceSizes": [
      {
        "resourceType": "script",
        "budget": 200
      }
    ]
  }
]

I have tried to change the second options section, but there was no result. I have taken the code from LightWallet's introduction page.