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

Importing css from node modules #55

Closed
mbujes opened this issue Sep 7, 2017 · 2 comments
Closed

Importing css from node modules #55

mbujes opened this issue Sep 7, 2017 · 2 comments
Labels

Comments

@mbujes
Copy link

mbujes commented Sep 7, 2017

I am trying to import bootstrap css file from npm module.

In angular-cli.json:

 "styles": [
        "styles.scss",
        "../node_modules/admin-lte/bootstrap/css/bootstrap.css"
]

In webpack.config

 "styles": [
      "./src/styles.scss",
      "./node_modules/admin-lte/bootstrap/css/bootstrap.min.css"
]

Styles are in the style.bundle but don't applied on the DOM

Can someone help me?

Regards

@glaucomorais
Copy link

In your angular.cli.json is defined to use scss extension for stylesheet?
Run this and see if it work: ng set defaults.styleExt scss.

@mbujes
Copy link
Author

mbujes commented Sep 8, 2017

Solved replacing in web.config css files management

{
        "exclude": [
          path.join(process.cwd(), "src/styles.scss")
        ],
        "test": /\.css$/,
        "loaders": ['style-loader', 'css-loader'],
        "include": [/node_modules/]
      },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants