MeltingDog MeltingDog - 1 month ago 11
JSON Question

Error 'udenfined "paths"' when overwriting gulpfile.js with gulpconfig.json

I have a gulpfile.js that has default paths set, eg:

paths: {
sass: ['source/style/*.scss', 'source/style/components/**/*.scss'],
}


However, I want to work from another directory with slightly different structure and so have set up a gulpconfig.json file with (within that directory):

{
"site": {
"dev": "http://localdev.mysite.com",
"drushAlias": "site",
"themePrefix": "si",
"minify": false
}
"paths": {
"sass":["sass/*.scss", "sass/components/**/*.scss"]
}
}


But this gives me an error when I try to run gulp:

undefined:8
"paths": {
^
SyntaxError: Unexpected string in JSON at position 152


Would anyone know why this could be occurring?

Answer

There is a comma missing between the } and "paths" making it invalid JSON. It needs to be as follows.

 {
  "site": {
    "dev": "http://localdev.mysite.com",
    "drushAlias": "site",
    "themePrefix": "si",
    "minify": false
  },
  "paths": {
    "sass":["sass/*.scss", "sass/components/**/*.scss"]
  }
}