Skip to content

How to include CSS from node_modules in project? #10059

Closed
@M1ck0

Description

@M1ck0

I am trying to

import 'bootstrap/dist/css/bootstrap.min.css';

in my next.js project but I get following error

Module parse failed: Unexpected token (6:3) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file

I have next.config.js file in root directory of project. It has this configuration

// next.config.js 
const withCSS = require('@zeit/next-css');

module.exports = withCSS({
  cssLoaderOptions: {
    url: false
  }
});

I followed this comment which apparentlyworks but not for me. Any ideas why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions