Skip to content

Commit

Permalink
refactor: drop webpack-dev-server v3 form CI and tests (#3352)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jul 27, 2022
1 parent fc293ee commit 0dba3db
Show file tree
Hide file tree
Showing 15 changed files with 130 additions and 356 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/nodejs.yml
Expand Up @@ -61,11 +61,6 @@ jobs:
node-version: [14.x, 16.x, 18.x]
webpack-version: [latest]
dev-server-version: [latest]
include:
- node-version: 16.x
os: ubuntu-latest
dev-server-version: version-3
webpack-version: latest

steps:
- uses: actions/checkout@v3
Expand All @@ -81,10 +76,6 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines

- name: Install webpack-dev-server ${{ matrix.dev-server-version }}
if: matrix.dev-server-version == 'version-3'
run: yarn add -W webpack-dev-server@${{ matrix.dev-server-version }} --ignore-engines

- name: Prepare environment for tests
run: yarn build:ci

Expand Down
13 changes: 5 additions & 8 deletions test/serve/basic/function-with-argv.config.js
@@ -1,5 +1,4 @@
const WebpackCLITestPlugin = require("../../utils/webpack-cli-test-plugin");
const { isDevServer4 } = require("../../utils/test-utils");

module.exports = (env, argv) => {
console.log(argv);
Expand All @@ -8,12 +7,10 @@ module.exports = (env, argv) => {
mode: "development",
devtool: false,
plugins: [new WebpackCLITestPlugin(["mode"], false, "hooks.compilation.taps")],
devServer: isDevServer4
? {
client: {
logging: "info",
},
}
: {},
devServer: {
client: {
logging: "info",
},
},
};
};
13 changes: 5 additions & 8 deletions test/serve/basic/function-with-env.config.js
@@ -1,5 +1,4 @@
const WebpackCLITestPlugin = require("../../utils/webpack-cli-test-plugin");
const { isDevServer4 } = require("../../utils/test-utils");

module.exports = (env) => {
console.log(env);
Expand All @@ -8,12 +7,10 @@ module.exports = (env) => {
mode: "development",
devtool: false,
plugins: [new WebpackCLITestPlugin(["mode"], false, "hooks.compilation.taps")],
devServer: isDevServer4
? {
client: {
logging: "info",
},
}
: {},
devServer: {
client: {
logging: "info",
},
},
};
};
24 changes: 7 additions & 17 deletions test/serve/basic/helper/base-dev-server.config.js
@@ -1,20 +1,10 @@
const { isDevServer4 } = require("../../../utils/test-utils");

let devServerConfig = {};

if (isDevServer4) {
devServerConfig = {
devMiddleware: {
publicPath: "/dev-server-my-public-path/",
},
client: {
logging: "info",
},
};
} else {
devServerConfig = {
const devServerConfig = {
devMiddleware: {
publicPath: "/dev-server-my-public-path/",
};
}
},
client: {
logging: "info",
},
};

module.exports = devServerConfig;
14 changes: 5 additions & 9 deletions test/serve/basic/log.config.js
@@ -1,15 +1,11 @@
const { isDevServer4 } = require("../../utils/test-utils");

module.exports = {
mode: "development",
infrastructureLogging: {
level: "log",
},
devServer: isDevServer4
? {
client: {
logging: "info",
},
}
: {},
devServer: {
client: {
logging: "info",
},
},
};
13 changes: 5 additions & 8 deletions test/serve/basic/multi-dev-server-output-public-path.config.js
@@ -1,6 +1,5 @@
const WebpackCLITestPlugin = require("../../utils/webpack-cli-test-plugin");
const { devServerConfig } = require("./helper/base-dev-server.config");
const { isDevServer4 } = require("../../utils/test-utils");

module.exports = [
{
Expand All @@ -11,13 +10,11 @@ module.exports = [
output: {
filename: "first-output/[name].js",
},
devServer: isDevServer4
? {
client: {
logging: "info",
},
}
: {},
devServer: {
client: {
logging: "info",
},
},
plugins: [new WebpackCLITestPlugin(["mode", "output"], false, "hooks.compilation.taps")],
},
{
Expand Down
13 changes: 5 additions & 8 deletions test/serve/basic/multi-output-public-path.config.js
@@ -1,5 +1,4 @@
const WebpackCLITestPlugin = require("../../utils/webpack-cli-test-plugin");
const { isDevServer4 } = require("../../utils/test-utils");

module.exports = [
{
Expand All @@ -11,13 +10,11 @@ module.exports = [
filename: "first-output/[name].js",
},
plugins: [new WebpackCLITestPlugin(["mode", "output"], false, "hooks.compilation.taps")],
devServer: isDevServer4
? {
client: {
logging: "info",
},
}
: {},
devServer: {
client: {
logging: "info",
},
},
},
{
name: "two",
Expand Down
13 changes: 5 additions & 8 deletions test/serve/basic/output-public-path.config.js
@@ -1,5 +1,4 @@
const WebpackCLITestPlugin = require("../../utils/webpack-cli-test-plugin");
const { isDevServer4 } = require("../../utils/test-utils");

module.exports = {
mode: "development",
Expand All @@ -8,11 +7,9 @@ module.exports = {
publicPath: "/my-public-path/",
},
plugins: [new WebpackCLITestPlugin(["mode", "output"], false, "hooks.compilation.taps")],
devServer: isDevServer4
? {
client: {
logging: "info",
},
}
: {},
devServer: {
client: {
logging: "info",
},
},
};

0 comments on commit 0dba3db

Please sign in to comment.