Skip to content

Commit

Permalink
Drop node_modules/ default exclusion from css-modules & postcss
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Wermke committed Jan 15, 2017
1 parent 03178a7 commit 3fba416
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions packages/css-modules/CHANGELOG.md
@@ -1,5 +1,9 @@
# @webpack-blocks/css-modules - Changelog

## Next release

- Breaking change: Dropped the default `node_modules/` exclusion

## 0.3.0

- Adapted to new API: Using `context` now
Expand Down
8 changes: 4 additions & 4 deletions packages/css-modules/index.js
Expand Up @@ -20,18 +20,18 @@ function cssModules (options) {
? '[hash:base64:10]'
: '[name]--[local]--[hash:base64:5]'

const exclude = options.exclude || /\/node_modules\//
const importLoaders = options.importLoaders || 1
const localIdentName = options.localIdentName || localIdentDefault

return (context) => ({
module: {
loaders: [
{
Object.assign({
test: context.fileType('text/css'),
exclude: Array.isArray(exclude) ? exclude : [ exclude ],
loaders: [ 'style-loader', 'css-loader?' + stringifyQueryParams({ importLoaders, localIdentName, modules: true }) ]
}
}, options.exclude ? {
exclude: Array.isArray(options.exclude) ? options.exclude : [ options.exclude ]
} : {})
]
}
})
Expand Down
4 changes: 4 additions & 0 deletions packages/postcss/CHANGELOG.md
@@ -1,5 +1,9 @@
# @webpack-blocks/postcss - Changelog

## Next release

- Breaking change: Dropped the default `node_modules/` exclusion

## 0.3.2

- Bug fix: PostCSS plugin configuration now works with webpack 2 ([#68](https://github.com/andywer/webpack-blocks/issues/68))
Expand Down
8 changes: 4 additions & 4 deletions packages/postcss/index.js
Expand Up @@ -17,7 +17,6 @@ module.exports = postcss
*/
function postcss (plugins, options) {
options = options || {}
const exclude = options.exclude || /\/node_modules\//

// https://github.com/postcss/postcss-loader#options
const postcssOptions = Object.assign(
Expand All @@ -31,11 +30,12 @@ function postcss (plugins, options) {
{
module: {
loaders: [
{
Object.assign({
test: context.fileType('text/css'),
exclude: Array.isArray(exclude) ? exclude : [ exclude ],
loaders: [ 'style-loader', 'css-loader', 'postcss-loader?' + JSON.stringify(postcssOptions) ]
}
}, options.exclude ? {
exclude: Array.isArray(options.exclude) ? options.exclude : [ options.exclude ]
} : {})
]
}
},
Expand Down

0 comments on commit 3fba416

Please sign in to comment.