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

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

Open
rzymek opened this issue Nov 5, 2017 · 0 comments · May be fixed by #32
Open

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

rzymek opened this issue Nov 5, 2017 · 0 comments · May be fixed by #32

Comments

@rzymek
Copy link

rzymek commented Nov 5, 2017

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"] 
                        }
                    }
                ]
            }
        ]
    },
rzymek added a commit to rzymek/react-material-floating-button that referenced this issue Nov 5, 2017
mfb.scss files includes scss files from `mfb/src/_`, but
those file were not included in `package.json`'s `files` section.

resolves nobitagit#31
rzymek added a commit to rzymek/react-material-floating-button that referenced this issue Nov 5, 2017
`mfb.scss` file includes scss files from `mfb/src/_`, but
those file were not included in `package.json`'s `files` section.

resolves nobitagit#31
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

Successfully merging a pull request may close this issue.

1 participant