Вопрос

Using Meteor + Stylus, how do you import a file in another folder starting from the root?

Given:

/css/colors.styl /home/home.styl

I know I can use @import '../css/colors' but it gets messier the deeper it goes. Is there a way to do something like @import '/css/colors'?

Это было полезно?

Решение

Starting in meteor 1.2, you can import a .styl file relative to your application's root directory with the following syntax:

@import '{}/client/imports/colors.styl'

See the package documentation for more details. Also note:

The package processes all .styl files, treating .styl as entry points and all files with extension .import.styl or a file in under an imports folder as an import.

So putting your imports under a directory with imports in the name is a good idea.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top