shakacode / bootstrap-sass-loader

Webpack Loader for the Sass version Twitter Bootstrap
MIT License
118 stars 25 forks source link

@import windows system path error #14

Closed fcaballero closed 9 years ago

fcaballero commented 9 years ago

Hi, I was testing this out on windows 8 with you example (https://github.com/justin808/bootstrap-sass-loader-example) which did not work, so I was debugging and I got that bootstrap-sass-styles.loader.js produce this:

@import "C:\usr\tech\bootstrap-sass-loader-example\_pre-bootstrap-customizations.scss";
@import "C:\usr\tech\bootstrap-sass-loader-example\node_modules\bootstrap-sass\assets\stylesheets\bootstrap\variables";
$icon-font-path: "node_modules\bootstrap-sass\assets\fonts\bootstrap\";
@import "C:\usr\tech\bootstrap-sass-loader-example\_bootstrap-customizations.scss";
.....
@import "C:\usr\tech\bootstrap-sass-loader-example\_main.scss";

as you can see, that separator "\" is not supported in @import CSS at-rule, so when it's compiling I get the next error:

ERROR in ./~/css-loader!./~/sass-loader!./~/bootstrap-sass-loader/bootstrap-sass-styles.loader.js!./bootstrap-sass.config.js
Module build failed: 
module.exports = {
       ^
      File to import not found or unreadable: ./_C:usrtech♂ootstrap-sass-loader-example_pre-bootstrap-customizations.scss
      in C:\usr\tech\bootstrap-sass-loader-example\bootstrap-sass.config.js (line 1, column 9)
 @ ./~/style-loader!./~/css-loader!./~/sass-loader!./~/bootstrap-sass-loader/bootstrap-sass-styles.loader.js!./bootstrap-sass.config.js 4:14-375

You could solve this by returning (probably you could have a better idea):

return source.replace(/\\/g, '/');

Regards, Fabián

justin808 commented 9 years ago

@fcaballero If you can give me a PR that supports windows, that would be awesome. Please be sure to test on Mac/Linux as well. I'd be happy to incorporate it.

justin808 commented 9 years ago

Looks like some pretty modest changes are needed: http://shapeshed.com/writing-cross-platform-node/

If anybody wants to submit a PR or if at least 5 people would like this, I'll fix this.

fcaballero commented 9 years ago

Hi @justin808 I will give you tomorrow the PR ;)

justin808 commented 9 years ago

OK -- super. For the time being, you can reference your repo/branch in your package.json file.

justin808 commented 9 years ago

@fcaballero If you can please test on linux or mac os as well, that would be great. Did you see the test/debug instructions and the https://github.com/justin808/bootstrap-sass-loader-example?

fcaballero commented 9 years ago

@justin808 Thanks a lot ;)

justin808 commented 8 years ago

@fcaballero We're having a windows issue on https://github.com/shakacode/bootstrap-loader/issues/4. Any chance that you could give us a hand?