I have a problem when I want to import a ".json" file in stylus. My file tree is as follows:
static/
├── css/
│ ├── stylus/
| │ ├── style.styl
│ ├── style.css
│ └── normalize.css
└── json/
└── media-queries.json
And inside my "style.styl" file I insert the following line:
json('..\..\json\media-queries.json')
It can be seen in the official documentation in the following section that is almost at the end of it: #json(path[, options]) http://stylus-lang.com/docs/bifs.html
The error that I get in the terminal is the following:
Error: style.styl:1:37 1| json('..\..\json\media-queries.json') ------------------------------------------^ failed to locate .json file ..\..\json\media-queries
From already thank you very much!
Try writing the
path
to the fileJSON
using/
(slash) instead of\
(backslash).For example: