Skip to content

Commit 3e8055f

Browse files
committed
refactor: migrate fixtures configs to ES module syntax
1 parent a9c2e64 commit 3e8055f

58 files changed

Lines changed: 228 additions & 165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

test/fixtures/cli-colors-default-stats/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
"use strict";
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
module.exports = {
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
5+
6+
export default {
47
mode: "development",
58
context: __dirname,
69
entry: "./foo.js",

test/fixtures/cli-colors-disabled/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
"use strict";
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
module.exports = {
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
5+
6+
export default {
47
mode: "development",
58
stats: {
69
colors: false,

test/fixtures/cli-colors-enabled/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
"use strict";
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
module.exports = {
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
5+
6+
export default {
47
mode: "development",
58
stats: {
69
colors: true,

test/fixtures/cli-empty-entry/webpack.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"use strict";
2-
3-
module.exports = {
1+
export default {
42
mode: "development",
53
stats: { orphanModules: true, preset: "detailed" },
64
entry: {},

test/fixtures/cli-entry-as-descriptor/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
"use strict";
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
module.exports = {
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
5+
6+
export default {
47
mode: "development",
58
context: __dirname,
69
entry: {

test/fixtures/cli-multi-entry/webpack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
"use strict";
1+
import path, { resolve } from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
const { resolve } = require("path");
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
45

5-
module.exports = {
6+
export default {
67
mode: "development",
78
stats: "detailed",
89
context: __dirname,

test/fixtures/cli-promise-config/webpack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
"use strict";
1+
import path, { join } from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
const { join } = require("path");
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
45

5-
module.exports = () =>
6+
export default () =>
67
new Promise((resolve) => {
78
resolve({
89
mode: "development",

test/fixtures/cli-single-entry/webpack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
"use strict";
1+
import path, { resolve } from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
const { resolve } = require("path");
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
45

5-
module.exports = {
6+
export default {
67
mode: "development",
78
stats: "detailed",
89
entry: resolve(__dirname, "./foo.js"),

test/fixtures/cli-target-config/webpack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
"use strict";
1+
import path, { resolve } from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
const { resolve } = require("path");
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
45

5-
module.exports = {
6+
export default {
67
mode: "development",
78
stats: "detailed",
89
entry: resolve(__dirname, "./foo.js"),

test/fixtures/cli-universal-compiler-config/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
"use strict";
1+
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
23

3-
module.exports = [
4+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
5+
6+
export default [
47
{
58
name: "client",
69
mode: "development",

0 commit comments

Comments
 (0)