Skip to content

Commit

Permalink
example(webpack): update webpack config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 13, 2022
1 parent 8c3ec69 commit c1bd0d5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions example/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@ module.exports = {
},
devServer: {
port: 8082,
before(app){
apiMocker(app, path.resolve('./mocker/index.js'), {
onBeforeSetupMiddleware: (devServer) => {
apiMocker(devServer.app, path.resolve('./mocker/index.js'), {
proxy: {
'/repos/(.*)': 'https://api.github.com/',
},
changeHost: true,
})
}

},
// before(app){
// apiMocker(app, path.resolve('./mocker/index.js'), {
// proxy: {
// '/repos/(.*)': 'https://api.github.com/',
// },
// changeHost: true,
// })
// }
},
plugins: [
new HtmlWebpackPlugin({
Expand Down

0 comments on commit c1bd0d5

Please sign in to comment.