Skip to content

Commit 2f577f4

Browse files
Jared PalmerJared Palmer
authored andcommitted
Pass thru underlying webpack instance in config
1 parent 134f71a commit 2f577f4

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ To extend webpack, you can define a function that extends its config via `backpa
8787
```js
8888
// backpack.config.js
8989
module.exports = {
90-
webpack: (config, options) => {
90+
webpack: (config, options, webpack) => {
9191
// Perform customizations to config
9292
// Important: return the modified config
9393
return config

examples/with-custom-webpack-config/backpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
webpack: (config, options) => {
2+
webpack: (config, options, webpack) => {
33
// Perform customizations to config
44
// Important: return the modified config
55

examples/with-typescript/backpack.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
const webpack = require('webpack')
2-
31
module.exports = {
4-
webpack: (config, options) => {
2+
webpack: (config, options, webpack) => {
53
config.entry.main = [
64
'./src/main.ts'
75
]

packages/backpack-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To extend webpack, you can define a function that extends its config via `backpa
6969
```js
7070
// backpack.config.js
7171
module.exports = {
72-
webpack: (config, options) => {
72+
webpack: (config, options, webpack) => {
7373
// Perform customizations to config
7474
// Important: return the modified config
7575
return config

packages/backpack-core/bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (fs.existsSync(configPath)) {
1919
}
2020

2121
const serverConfig = userConfig.webpack
22-
? userConfig.webpack(defaultConfig(options), options)
22+
? userConfig.webpack(defaultConfig(options), options, webpack)
2323
: defaultConfig(options)
2424

2525
process.on('SIGINT', process.exit)

packages/backpack-core/bin/dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if (fs.existsSync(configPath)) {
2020
}
2121

2222
const serverConfig = userConfig.webpack
23-
? userConfig.webpack(defaultConfig(options), options)
23+
? userConfig.webpack(defaultConfig(options), options, webpack)
2424
: defaultConfig(options)
2525

2626
process.on('SIGINT', process.exit)

0 commit comments

Comments
 (0)