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

Doesn't use moduleDirectories #3

Closed
jhnns opened this issue May 15, 2013 · 7 comments
Closed

Doesn't use moduleDirectories #3

jhnns opened this issue May 15, 2013 · 7 comments

Comments

@jhnns
Copy link
Member

jhnns commented May 15, 2013

I'm currently using less and bootstrap in my project. I'm importing some bootstrap less files like this:

@import "bootstrap/less/reset";
@import "bootstrap/less/grid";

and in my webpack config I have

config.resolve.modulesDirectories = ["components", "node_modules"];

but the imports can't be resolved.

@jhnns
Copy link
Member Author

jhnns commented May 15, 2013

And bootstrap is placed in my app under /components/bootstrap. 😄

@sokra
Copy link
Member

sokra commented May 15, 2013

@import "~bootstrap/less/reset.less";
@import "~bootstrap/less/grid.less";

It cannot be @import "bootstrap/less/reset" because this would mean the folder bootstrap

@jhnns
Copy link
Member Author

jhnns commented May 15, 2013

Ah thx

@jupl
Copy link

jupl commented May 22, 2014

I'm having issues getting this to work. In a test, I created a file with the line

@import '~bootstrap/less/normalize.less';

and I get the error:

Module build failed: Error: Cannot resolve module node_modules/bootstrap/less/variables.less

I do have Bootstrap downloaded under node_modules.

@jhnns
Copy link
Member Author

jhnns commented May 23, 2014

How did you install bootstrap into node_modules? Via npm? The bootstrap-module on npm is not Twitter Bootstrap.

I think it's better to download bootstrap via bower and add this line to your webpack.config.js:

config.resolve.modulesDirectories = ["bower_components", "node_modules"];

@jupl
Copy link

jupl commented May 23, 2014

Ugh, I'm such a dunce. I screwed up my modulesDirectories during some late-night coding. I got it to work. Anyway, in case you're curious I just added Bootstrap to package.json as a tarball to reduce having to rely on extra tools:

"bootstrap": "https://github.com/twbs/bootstrap/archive/v3.1.1.tar.gz"

Thanks for the help! :D

@jhnns
Copy link
Member Author

jhnns commented May 23, 2014

Ah ok. I'm glad it finally worked 😉

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

3 participants