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

css-module composes from other module not working. #443

Closed
mrdulin opened this issue Mar 8, 2017 · 9 comments
Closed

css-module composes from other module not working. #443

mrdulin opened this issue Mar 8, 2017 · 9 comments
Assignees

Comments

@mrdulin
Copy link

mrdulin commented Mar 8, 2017

webpack.config.js:

{
        test: /\.module\.(scss|css)$/,
        include: /\.module\.(scss|css)$/,
        loader: ExtractTextPlugin.extract('style', `css?${JSON.stringify(cssLoaderQuery)}!sass?sourceMap`)
      },
      {
        test: /\.scss$/,
        exclude: [/node_modules/, /\.module\.(scss|css)$/],
        loader: ExtractTextPlugin.extract('style', `css?sourceMap!sass?sourceMap`)
      }

src/index.module.scss:

.button-primary{
    composes: button from './common/sass/button.scss';
    background: lightblue;
}

.link-small{
    // composes: link from './common/sass/link.css';
    composes: link from 'common/sass/link.module.css';
    font-size: 14px;
}

.list-m{
    composes: list from 'common/sass/list.module.scss';
    border: 1px solid #ddd;
}

All of composes not working. No matter I use alias or relative path.

My project directory structure:

-- update 2017.04.11 ---

Here is my webpack.config.js: https://github.com/mrdulin/webpack1.x/blob/master/css-loader/css-module-import-module/webpack.config.js

the issue still exist.

@ekulabuhov
Copy link
Member

Hi! Could you please upload this example as a gist?

@PanJ
Copy link

PanJ commented Mar 8, 2017

Might relate to #131. I'm experience the issue as well. Trying to make minimal example of the issue.

@PanJ
Copy link

PanJ commented Mar 8, 2017

In my case it's webpack-contrib/style-loader#179

@mrdulin
Copy link
Author

mrdulin commented Mar 9, 2017

@rozzzly
Copy link

rozzzly commented Apr 10, 2017

Any update on this? I've been experiencing it too, and it's like half the reason to use css modules.

@michael-ciniawsky
Copy link
Member

@rozzzly Please provide more info about your current setup (file tree, webpack.config.js)

@mrdulin
Copy link
Author

mrdulin commented Apr 11, 2017

@rozzzly
Copy link

rozzzly commented Apr 12, 2017

After some more investigation, it's an issue between postcss-loader and css-loader. I opened an issue there as it might be out of scope of css-loader webpack-contrib/postcss-loader#198

@alexander-akait
Copy link
Member

Look webpack-contrib/postcss-loader#198 (comment). Feel free to feedback.

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

No branches or pull requests

7 participants