I use webpack 3 for my build process.
webpack.config.js:
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
use: [
{
loader: "css-loader",
options: {
minimize: true,
modules: true,
importLoaders: 1
}
},
{
loader: "postcss-loader",
options: {
path: './postcss.config.js'
}
},
{
loader: "sass-loader",
options: {
includePaths: [dirAssets]
}
}
],
fallback: "style-loader",
publicPath: './'
})
},
I require my main.scss in main.js and in dev and build env my selectors looks like this:
._1RIaajDV8RXjVfAFhmcSaz {}
It should looks like:
.h1 {}
Any Idea? I can't solve this problem.
modules: trueis replacing all your classes with alocalIdentName(hash:base64), set it to false or modify the generated local ident name, check my answer below...