So I have this code below in my webpack 2 config. It seems to work other than it is altering my css class names.
modules:
test: [/\.scss$/, /\.sass$/],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
}
},
{
loader: 'postcss-loader',
options: {
importLoaders: 1
}
},
{
loader: 'sass-loader'
},
],
}),
plugins:
new ExtractTextPlugin({
filename: 'global.css',
allChunks: true,
}),
CSS Outputted in global.css:
._346v3lRS9p5yMQOIqOJas_ {
max-width: 100%;
height: auto; }
._3jLdPG7qJYZI8jVfnpr2sy {
padding: 0.25rem;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 0.15rem;
transition: all 0.2s ease-in-out;
max-width: 100%;
height: auto; }
._28w9sGKbZxXO8saGymF0cf {
display: inline-block; }
What is going on that causes that?
Something to note is I figured out if I change the modules ExtractTextPlugin to look like so it doesn't do this with the css class names and looks fine:
{
test: [/\.scss$/, /\.sass$/],
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: `css-loader?moudules=true&!postcss-loader?importLoaders=1!sass-loader?`,
}),
},
So I am really curious what is going on?