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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 2018
"ecmaVersion": 2022
},
"env": {
"commonjs": true,
"es2017": true,
"es2022": true,
"node": true
},
"overrides": [
Expand All @@ -21,6 +21,7 @@
},
{
"files": [
"scripts/test.mjs",
"test/jest-test-setup.js",
"test/helpers/{,!(fixtures)*/}*.js",
"test/mocks/**/*.js",
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"scripts": {
"test": "run-s -c test:pre \"test:exec {@}\" test:post --",
"test:wds-4": "cross-env WDS_VERSION=4 yarn test",
"test:exec": "node scripts/test.js",
"test:exec": "node --experimental-vm-modules scripts/test.js",
"test:pre": "run-s -c test:pre:*",
"test:pre:0": "yarn link",
"test:pre:1": "yarn link @pmmmwh/react-refresh-webpack-plugin",
Expand Down Expand Up @@ -75,7 +75,7 @@
"@types/jest": "^29.5.12",
"@types/json-schema": "^7.0.15",
"@types/module-alias": "^2.0.4",
"@types/node": "^22.13.14",
"@types/node": "^24.10.1",
"@types/webpack": "^5.28.5",
"babel-loader": "^10.0.0",
"cross-env": "^7.0.3",
Expand All @@ -85,7 +85,7 @@
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-prettier": "^5.1.3",
"fs-extra": "^11.2.0",
"get-port": "^5.1.1",
"get-port": "^7.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-environment-node": "^29.7.0",
Expand All @@ -97,13 +97,13 @@
"npm-run-all2": "^7.0.2",
"prettier": "^3.3.0",
"puppeteer": "^24.4.0",
"react-refresh": "^0.17.0",
"react-refresh": "^0.18.0",
"sourcemap-validator": "^2.1.0",
"terser-webpack-plugin": "^5.3.10",
"type-fest": "^4.18.3",
"typescript": "~5.4.5",
"type-fest": "^4.41.0",
"typescript": "~5.9.3",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.0.4",
"webpack-dev-server-v4": "npm:webpack-dev-server@^4.8.0",
"webpack-hot-middleware": "^2.26.1",
Expand All @@ -114,7 +114,7 @@
"@types/webpack": "5.x",
"react-refresh": ">=0.10.0 <1.0.0",
"sockjs-client": "^1.4.0",
"type-fest": ">=0.17.0 <5.0.0",
"type-fest": ">=0.17.0 <6.0.0",
"webpack": "^5.0.0",
"webpack-dev-server": "^4.8.0 || 5.x",
"webpack-hot-middleware": "2.x",
Expand Down Expand Up @@ -143,7 +143,7 @@
"resolutions": {
"memfs": "^4.0.0",
"rimraf": "^5.0.0",
"type-fest": "^4.20.0"
"type-fest": "^4.41.0"
},
"engines": {
"node": ">=18.12"
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/sandbox/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path');
const fse = require('fs-extra');
const getPort = require('get-port');
const { nanoid } = require('nanoid');
const { getIndexHTML, getPackageJson, getWDSConfig } = require('./configs');
const { killTestProcess, spawnWebpackServe } = require('./spawn');
Expand Down Expand Up @@ -64,6 +63,7 @@ const rootSandboxDir = path.join(__dirname, '../..', '__tmp__');
* @returns {Promise<[SandboxSession, function(): Promise<void>]>}
*/
async function getSandbox({ esModule = false, id = nanoid(), initialFiles = new Map() } = {}) {
const { default: getPort } = await import('get-port');
const port = await getPort();

// Get sandbox directory paths
Expand Down
29 changes: 15 additions & 14 deletions test/loader/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,21 @@ describe('loader', () => {
const { execution, sourceMap } = compilation.module;

expect(sourceMap).toMatchInlineSnapshot(`
"{
"version": 3,
"file": "main.js",
"mappings": ";;;;;;;;;;AAAA",
"sources": [
"webpack://cjs/./index.js"
],
"sourcesContent": [
"module.exports = 'Test';\\n"
],
"names": [],
"sourceRoot": ""
}"
`);
"{
"version": 3,
"file": "main.js",
"mappings": ";;;;;;;;;;AAAA",
"sources": [
"webpack://cjs/./index.js"
],
"sourcesContent": [
"module.exports = 'Test';\\n"
],
"names": [],
"ignoreList": [],
"sourceRoot": ""
}"
`);
expect(() => {
validate(execution, sourceMap);
}).not.toThrow();
Expand Down
Loading