How do I import bootstrap-sass?
See original GitHub issueadded this stuff to webpack loaders:
{test: /\.scss/, loader: 'style!css!sass?includePaths[]=' +
(path.resolve(__dirname, "./node_modules"))},
{test: /\.woff(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }
and in my scss: @import “bootstrap-sass/assets/stylesheets/_bootstrap.scss”;
But I get bunch of errors resolving the relative paths with bootstrap-sass
ERROR in ./~/css-loader!./~/sass-loader?includePaths[]=/Users/kharriger/code/webpack-template/node_modules!./src/sass/all.scss Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/fonts/bootstrap/glyphicons-halflings-regular.eot in /Users/kharriger/code/webpack-template/src/sass @ ./~/css-loader!./~/sass-loader?includePaths[]=/Users/kharriger/code/webpack-template/node_modules!./src/sass/all.scss 2:3068-3130 2:3144-3206
ERROR in ./~/css-loader!./~/sass-loader?includePaths[]=/Users/kharriger/code/webpack-template/node_modules!./src/sass/all.scss Module not found: Error: Cannot resolve ‘file’ or ‘directory’ …/fonts/bootstrap/glyphicons-halflings-regular.woff in /Users/kharriger/code/webpack-template/src/sass @ ./~/css-loader!./~/sass-loader?i
Issue Analytics
- State:
- Created 9 years ago
- Reactions:13
- Comments:30 (7 by maintainers)
Top GitHub Comments
Setting icon path works, but you need to prefix the path with a ~:
$icon-font-path: “~bootstrap-sass/assets/fonts/bootstrap/”; @import “bootstrap-sass/assets/stylesheets/_bootstrap.scss”;
If you don’t add the ~ then it gets translated to ./bootstrap-sass/assets/fonts/bootstrap.
Thanks!
I found that setting
$bootstrap-sass-asset-helper: true
instead of using$icon-font-path
solved the issue;$icon-font-path
was not really helping.