Skip to content

webpack2 css-loader css-modules #396

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

Closed
fengyun2 opened this issue Dec 29, 2016 · 4 comments
Closed

webpack2 css-loader css-modules #396

fengyun2 opened this issue Dec 29, 2016 · 4 comments

Comments

@fengyun2
Copy link

fengyun2 commented Dec 29, 2016

versions:

"webpack": "^2.1.0-beta.27",
"css-loader": "^0.26.1"

problem:

I want to custom css-modules localIdentName: localIdentName=[path]___[name]__[local]___[hash:base64:5]

demo:

{
                test: /\.(scss|sass)$/,
                loader: ExtractTextPlugin.extract({
                    fallbackLoader: 'style-loader',
                    loader: [
                    {
                        loader: 'css-loader',
                        query: {
                            modules: true,
                            importLoaders: 1,
                            localIdentName: '[path]___[name]__[local]___[hash:base64:5]'
                        }
                    },
                    'postcss-loader',
                    'sass-loader']
                })
            },

But the localIdentName=[path]___[name]__[local]___[hash:base64:5] of the [path] can't analyze. However, in webpack1.3 can be analyzed out.

result

image

@SickSAMA
Copy link

If you're using LoaderOptionsPlugin, specify context.

new webpack.LoaderOptionsPlugin({
  options: {
    context: __dirname,
    postcss: ...
  }
})

@ghost
Copy link

ghost commented Jan 30, 2017

it work for me. Thank U very much.

@tvrcgo
Copy link

tvrcgo commented Mar 16, 2017

Works for me ! thanks.

@tonokim
Copy link

tonokim commented Apr 13, 2017

Is work for me !3Q

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

No branches or pull requests

4 participants