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

Including Font-awesome & Bootstrap SASS #215

Open
roymj88 opened this issue Mar 23, 2017 · 2 comments
Open

Including Font-awesome & Bootstrap SASS #215

roymj88 opened this issue Mar 23, 2017 · 2 comments

Comments

@roymj88
Copy link

roymj88 commented Mar 23, 2017

Hi,

Please note that ive seen #97 & #99 and it doesnt provide a solution or a clear step and hence opening an issue here.

Ive setup base using NG6-starter and currently im trying to add external modules like bootstrap, fontawesome etc.

For Bootstrap i did the following:

╰─$ npm install --save angular-ui-bootstrap bootstrap
╰─$ npm install bootstrap-sass --save 

In app.js

import Bootstrap from 'angular-ui-bootstrap';

angular.module('app', [
    uiRouter,
    Common,
    Components,
    Bootstrap
  ])

This gives following error

Uncaught Error: Cannot find module "!!../../node_modules/css-loader/index.js!../../node_modules/sass-loader/index.js!./app.scss"
    at webpackMissingModule (app.scss:4)
    at Object.416 (app.scss:4)
    at __webpack_require__ (bootstrap 381c5ef…:585)
    at fn (bootstrap 381c5ef…:109)
    at Object.414 (app.component.js:2)
    at __webpack_require__ (bootstrap 381c5ef…:585)
    at fn (bootstrap 381c5ef…:109)
    at Object.312 (app.js:5)
    at __webpack_require__ (bootstrap 381c5ef…:585)
    at fn (bootstrap 381c5ef…:109)

For CSS, tried:

@import '../node_modules/bootstrap/dist/css/bootstrap';

And this also ends in error.

For Font-awesome, i tried the following:

╰─$ npm install font-awesome --save                                                                               

In App.scss

@import 'font-awesome/scss/font-awesome.scss';    

Both doesnt work. Help is much appreciated.

@ghost
Copy link

ghost commented Mar 28, 2017

First get bootstrap-loader. Follow the install instructions and make sure to install bootstrap-sass.
Pay attention to its dependencies as they may not be installed automatically (url-loader and file-loader for instance).

As of the installation of bootstrap-loader. Make sure to use the entry property instead of the require attribute.

In case you encounter an error during npm start like:

cannot read file. Use an appropriate loader ... some special signs or artifacts... <?>

Go here and adapt url-loader config.

@timothylombrana
Copy link

@hanssulo tried this, there seems to be an issue with bootstrap loader and newer node versions. We're you able to get it to work and if so which version of node? Also maybe you could share the config file, please.

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