Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JounQin opened this issue Sep 5, 2016 · 3 comments
Closed

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

JounQin opened this issue Sep 5, 2016 · 3 comments

Comments

@JounQin
Copy link

JounQin commented Sep 5, 2016

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
Copy link

hiulit commented Sep 5, 2016

This issue is related to #121

@ghost
Copy link

ghost commented Sep 12, 2016

@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
Copy link
Author

JounQin commented May 14, 2017

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

@JounQin JounQin closed this as completed May 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants