Skip to content

mfb.scss unsuable without _/_slidein.scss in distribution  #31

Description

@rzymek

Problem
The mfb.scss file included in the npm distribution references _/_slidein.scss which is not included.
That makes mfb.scss almost unusable. That is

@import '~react-mfb/mfb.scss'; 

causes

ERROR in ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js?{}!./src/app/mfb.scss
Module build failed: 
@import "_/_slidein";
^
      File to import not found or unreadable: _/_slidein.

Solution
Include mfb/src/_ folder in the npm distribution.

Workaround
When using webpack with sass-loader

  1. Include a copy of mfb/src/_ in your project's sources, e.g in src/_ folder
  2. In webpack.config.js include:
    module: {
        rules: [
           /*...*/
            {
                test: /\.scss$/,
                use: [
                    'style-loader',
                    'css-loader',
                    {
                        loader: 'sass-loader',
                        options: {
                           /* or other directory where you've placed the copy of _*/
                            includePaths: ["src"] 
                        }
                    }
                ]
            }
        ]
    },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions