CSS modules EVERYWHERE!

This commit is contained in:
Jeff Avallone 2018-02-13 18:15:18 -05:00
parent 6ab4978a03
commit 6b55f1ec72
3 changed files with 28 additions and 52 deletions

View File

@ -17,7 +17,7 @@ a {
color: inherit; color: inherit;
} }
ul.inline { ul:global(.inline) {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -28,7 +28,7 @@ ul.inline {
white-space: nowrap; white-space: nowrap;
} }
&.with-separator { &:global(.with-separator) {
& li:after { & li:after {
content: '//'; content: '//';
padding: 0 0.5rem; padding: 0 0.5rem;

View File

@ -98,54 +98,27 @@ module.exports = {
loader: 'babel-loader' loader: 'babel-loader'
}, },
{ {
oneOf: [ test: /\.css$/,
{ use: ExtractTextPlugin.extract({
test: /\.css$/, fallback: 'style-loader',
exclude: /components/, use: [
use: ExtractTextPlugin.extract({ {
fallback: 'style-loader', loader: 'css-loader',
use: [ options: {
{ importLoaders: 1,
loader: 'css-loader', minimize: true,
options: { sourceMap: true,
importLoaders: 1, modules: true
minimize: true, }
sourceMap: true, },
} {
}, loader: 'postcss-loader',
{ options: {
loader: 'postcss-loader', ident: 'postcss'
options: { }
ident: 'postcss' }
} ]
} })
]
})
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
importLoaders: 1,
minimize: true,
sourceMap: true,
modules: true
}
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss'
}
}
]
})
},
]
}, },
{ {
test: /\.svg$/, test: /\.svg$/,

View File

@ -43,9 +43,12 @@ module.exports = [
// Replace the rule for CSS files // Replace the rule for CSS files
{ {
test: /\.css$/, test: /\.css$/,
loader: 'css-loader/locals' loader: 'css-loader/locals',
options: {
modules: true
}
}, },
...common.module.rules.filter(rule => !rule.oneOf) ...common.module.rules.filter(rule => !rule.test.test('file.css'))
] ]
} }
} }