Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

[v8.x] loader-merge: Replace object-rest-spread example #941

Merged
merged 1 commit into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions docs/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ neutrino.config.module
.rule('compile')
.loader('babel', 'babel-loader', {
options: {
plugins: ['object-rest-spread']
plugins: ['your-babel-plugin']
}
});

Expand All @@ -359,7 +359,7 @@ neutrino.config.module
.rule('compile')
.use('babel')
.loader('babel-loader')
.options({ plugins: ['object-rest-spread'] });
.options({ plugins: ['your-babel-plugin'] });
```

- Updates to config for modifying loaders (from webpack-chain v3 upgrade). The function now gets its options directly
Expand All @@ -371,15 +371,15 @@ neutrino.config.module
.rule('compile')
.loader('babel', props => merge(props, {
options: {
plugins: ['object-rest-spread']
plugins: ['your-babel-plugin']
}
}));

// Modifying loaders in v5
neutrino.config.module
.rule('compile')
.use('babel')
.tap(options => merge(options, { plugins: ['object-rest-spread'] }));
.tap(options => merge(options, { plugins: ['your-babel-plugin'] }));
```

- Updates to `include` and `exclude` for rules (from webpack-chain v3). In the previous webpack-chain
Expand Down
4 changes: 2 additions & 2 deletions docs/packages/loader-merge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ and plug it into Neutrino:
const loaderMerge = require('@neutrinojs/loader-merge');

neutrino.use(loaderMerge('compile', 'babel'), {
plugins: ['object-rest-spread']
plugins: ['your-babel-plugin']
});

// Equivalent to:
neutrino.config.module
.rule('compile')
.use('babel')
.tap(options => require('deepmerge')(options, {
plugins: ['object-rest-spread']
plugins: ['your-babel-plugin']
}));
```

Expand Down
4 changes: 2 additions & 2 deletions packages/loader-merge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ and plug it into Neutrino:
const loaderMerge = require('@neutrinojs/loader-merge');

neutrino.use(loaderMerge('compile', 'babel'), {
plugins: ['object-rest-spread']
plugins: ['your-babel-plugin']
});

// Equivalent to:
neutrino.config.module
.rule('compile')
.use('babel')
.tap(options => require('deepmerge')(options, {
plugins: ['object-rest-spread']
plugins: ['your-babel-plugin']
}));
```

Expand Down