Skip to content
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

Merge module rules with custom webpack config #8

Merged
merged 7 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ module.exports = function(env, args) {
};
```

If you want to adapt predefined rules or add new ones you may do so by matching `test`-expression:

```Javascript
module.exports = function(env, args) {
return {
module: {
rules: [
{
test: /\.(sass|scss)$/, // use same expression if you want to modify rule
...
}
]
},
};
};
```

To remove entry points from webpack, you can set them to null in your own configuration

## Using modernizr
Expand Down
11 changes: 10 additions & 1 deletion helpers/configHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ function buildCustomConfiguration(environment) {
const customConfig = getCustomWebpackConfiguration();

return function (env, args) {
return mergeWithCustomize({
return mergeWithRules({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module: {
rules : {
test: "match",
use: {
loader: "match",
options: "replace"
}
}
},
customizeObject(a, b, key) {
if (key === 'entry') {
Object.keys(a).forEach((key) => {
Expand Down