Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions examples/api/simple/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ const WebpackDevServer = require('../../../lib/Server');
const webpackConfig = require('./webpack.config');

const compiler = Webpack(webpackConfig);
const devServerOptions = Object.assign({}, webpackConfig.devServer, {
open: true,
});
const devServerOptions = { ...webpackConfig.devServer, open: true };
const server = new WebpackDevServer(devServerOptions, compiler);

server.listen(8080, '127.0.0.1', () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
}
}

const result = Object.assign(defaults, config);
const result = { ...defaults, ...config };
const onBeforeSetupMiddleware = ({ app }) => {
app.get('/.assets/*', (req, res) => {
const filename = path.join(__dirname, '/', req.path);
Expand Down Expand Up @@ -87,7 +87,7 @@ module.exports = {
};

if (result.output) {
Object.assign(result.output, output);
result.output = { ...result.output, ...output };
} else {
result.output = output;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/normalizeOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function normalizeOptions(compiler, options, logger, cacheDir) {
target: options.proxy[context],
};
} else {
proxyOptions = Object.assign({}, options.proxy[context]);
proxyOptions = { ...options.proxy[context] };
proxyOptions.context = correctedContext;
}

Expand Down
13 changes: 5 additions & 8 deletions test/e2e/hot-and-live-reload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,11 @@ describe('hot and live reload', () => {
);

const compiler = webpack(reloadConfig);
const devServerOptions = Object.assign(
{},
{
host: '0.0.0.0',
port,
},
mode.options
);
const devServerOptions = {
host: '0.0.0.0',
port,
...mode.options,
};
const server = new Server(devServerOptions, compiler);

await new Promise((resolve, reject) => {
Expand Down
13 changes: 5 additions & 8 deletions test/e2e/logging.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,11 @@ describe('logging', () => {
webSocketServer.webSocketServer || 'default'
})`, async () => {
const compiler = webpack({ ...config, ...testCase.webpackOptions });
const devServerOptions = Object.assign(
{},
{
host: '0.0.0.0',
port,
},
testCase.devServerOptions
);
const devServerOptions = {
host: '0.0.0.0',
port,
...testCase.devServerOptions,
};
const server = new Server(devServerOptions, compiler);

await new Promise((resolve, reject) => {
Expand Down
Loading