Comments (8)
Hm, can't seem to reproduce in simple project so it's definitely something I do wrong. Or maybe version differences. This is the error I get on my unfortunately closed source project:
~/dev/projects/kostbevakningen $ webpack --display-error-details
[bootstrap-sass-loader]: styleLoader: style-loader!css-loader!sass-loader
[bootstrap-sass-loader]: bootstrap-sass location: ../../node_modules/bootstrap-sass/assets
[bootstrap-sass-loader]: Setting: $icon-font-path: '../../node_modules/bootstrap-sass/assets/fonts/bootstrap/';
[bootstrap-sass-loader]: fileName for mainSass: ../../_kostbevakningen-bootstrap.scss
Hash: 09d93d3636a81d4cf8b5
Version: webpack 1.12.1
Time: 1683ms
Asset Size Chunks Chunk Names
beta.entry.js 340 kB 0 [emitted] beta
statistics.entry.js 175 kB 1 [emitted] statistics
[4] ./app/bootstrap/kostbevakningen-bootstrap.js 54 bytes {0} [built]
+ 88 hidden modules
ERROR in ./~/css-loader!./~/sass-loader!./~/bootstrap-sass-loader/bootstrap-sass-styles.loader.js!./app/bootstrap/bootstrap-sass.config.js
Module build failed:
'component-animations': true,
^
File to import not found or unreadable: ../../_kostbevakningen-bootstrap.scss
in /Users/viktor/dev/projects/kostbevakningen/app/bootstrap/bootstrap-sass.config.js (line 41, column 9)
Error:
'component-animations': true,
^
File to import not found or unreadable: ../../_kostbevakningen-bootstrap.scss
in /Users/viktor/dev/projects/kostbevakningen/app/bootstrap/bootstrap-sass.config.js (line 41, column 9)
at options.error (/Users/viktor/dev/projects/kostbevakningen/node_modules/node-sass/lib/index.js:276:32)
@ ./~/style-loader!./~/css-loader!./~/sass-loader!./~/bootstrap-sass-loader/bootstrap-sass-styles.loader.js!./app/bootstrap/bootstrap-sass.config.js 4:14-211
Note the "../..". These are not there in config:
mainSass: './_kostbevakningen-bootstrap.scss',
For now I just made a
ln -s app/bootstrap/_kostbevakningen-bootstrap.scss ./_kostbevakningen-bootstrap.scss
and it works but it's really annoying.
from bootstrap-sass-loader.
Ok, so over here:
https://github.com/shakacode/bootstrap-sass-loader/blob/master/bootstrap-sass-styles.loader.js#L54
we're using Path.relative that takes two absolute paths to get a relative.
But the path I'm sending isn't absolute, right? The examples also gives relative:
mainSass: './_main.scss',
https://nodejs.org/api/path.html#path_path_relative_from_to
from bootstrap-sass-loader.
I added some debugging and got:
[bootstrap-sass-loader]: Loader.context: /Users/viktor/dev/projects/kostbevakningen/app/bootstrap
[bootstrap-sass-loader]: filename: ./_kostbevakningen-bootstrap.scss
[bootstrap-sass-loader]: path.relative(loader.context, fileName): ../../_kostbevakningen-bootstrap.scss
[bootstrap-sass-loader]: fileName for mainSass: ../../_kostbevakningen-bootstrap.scss
So I guess that particular function is used also later on for imports but maybe we could just resolve the path in config to an absolute first?
from bootstrap-sass-loader.
Oh, ok, I get it. The files are always relative root of webpack?
from bootstrap-sass-loader.
So I have a file
/Users/viktor/dev/projects/kostbevakningen/app/bootstrap/bootstrap-sass.config.js
but here I need to write:
mainSass: './app/bootstrap/_kostbevakningen-bootstrap.scss'
to get to
/Users/viktor/dev/projects/kostbevakningen/app/bootstrap/_kostbevakningen-bootstrap.scss
I would have thought the semantics would be that of require or @import that it's relative the file I'm writing in :)
from bootstrap-sass-loader.
@hedefalk Is there any issue still? Possibly can you give me a PR on what could improve the docs? Open source contributions are always appreciated! Thanks so much!
from bootstrap-sass-loader.
@justin808 I could get up and running once I realized that the path's where relative webpack.config.js and not the file they're defined in.
I'll get back with a PR if I can get relative paths working better. Thanks!
from bootstrap-sass-loader.
Thanks @hedefalk! I hope you enjoy the module.
from bootstrap-sass-loader.
Related Issues (20)
- Cannot load files... HOT 4
- File to import not found or unreadable with sass-loader 1.0.3 HOT 9
- @import scss file hot reload HOT 2
- 1.0.7 ERROR: Could not find path to config.bootstrapCustomizations HOT 3
- How to debug when HMR stops working? HOT 4
- Placeholder for Bootstrap 4.0 HOT 15
- getting it to work HOT 2
- how do i include bootswatch customizations for _variables and _bootswatch? HOT 5
- extract text plugin HOT 3
- Add global wrapper for CSS Modules HOT 1
- Loading only bootstrap styles HOT 6
- "1.a Complete Bootstrap" not working for me HOT 2
- Feature request: Ability to turn off scripts and dependency on jquery HOT 2
- Migration to bootstrap-loader HOT 1
- bootstrap-sass-loader with eslint-loader HOT 2
- How can I access bootstrap variables? HOT 11
- Unable to parse fonts HOT 1
- Style loader class name spaced HOT 1
- t
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-sass-loader.