maxmx / bootstrap-stylus

Port of Bootstrap to Stylus
MIT License
585 stars 113 forks source link

Is the relative path in `index.styl` wrong? #126

Closed JounQin closed 7 years ago

JounQin commented 8 years ago

The relative path in index.styl are all like bootstrap/*.styl, but index.styl itself is under bootstrap directory, so how could it resolve them properly?

Might it be the reason that webpack could not resolve the dependent styles? #122

hiulit commented 8 years ago

This issue is related to #121

ghost commented 8 years ago

@JounQin, the stylus has the -I (Include) option to add the bootstrap-styl to lookup paths:

stylus --help 2>&1 | grep '\-I'`
    -I, --include <path>    Add <path> to lookup paths

It may be used like this:

# compile the $baseAbsDirPath/css/main.styl to the $baseAbsDirPath/css/main.css
cd $baseAbsDirPath/css && stylus -I $baseAbsDirPath/node_modules/bootstrap-styl -c --disable-cache < main.styl > main.css

The contents of the $baseAbsDirPath/css/main.styl:

@require "../node_modules/bootstrap-styl/bootstrap/index"
@require "../node_modules/bootstrap-styl/bootstrap/theme"

Probably webpack has some setting for that too.

JounQin commented 7 years ago

Just use paths param of stylus-loader, if you're using sourcemap, you should use absolute path not just node_modules/bootstrap-styl.