diff --git a/e2e/.babelrc.js b/e2e/.babelrc.js index e9bb71e44aa..42b1dba8322 100644 --- a/e2e/.babelrc.js +++ b/e2e/.babelrc.js @@ -1,7 +1,6 @@ // https://github.com/viruscamp/babel-plugin-transform-imports#using-a-function-as-the-transformer const path = require('path'); -const siteDir = path.resolve('./e2e/site'); const testsDir = path.resolve('./e2e/tests'); const testsBuiltDir = path.resolve('./e2e/dist'); @@ -14,18 +13,17 @@ module.exports = { '\\..*': { skipDefaultConversion: true, transform: function (importName, matches, filename) { - const file = path.resolve( - path.dirname(filename), - `${matches[0]}.js` - ); - return path + const file = path.resolve(path.dirname(filename), `${matches[0]}`); + return `/${path .relative( - siteDir, - file.startsWith(testsDir) - ? path.resolve(testsBuiltDir, path.relative(testsDir, file)) - : file + process.cwd(), + resolve( + file.startsWith(testsDir) + ? path.resolve(testsBuiltDir, path.relative(testsDir, file)) + : file + ) ) - .replaceAll('\\', '/'); + .replaceAll('\\', '/')}`; }, }, }, diff --git a/package-lock.json b/package-lock.json index 6eb275b88f4..3fd18519fad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4002,7 +4002,7 @@ }, "node_modules/babel-plugin-transform-imports": { "version": "1.7.0", - "resolved": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git#b14734f4531642914c69a95b54ba4779ef8cce56", + "resolved": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git#e105857c5bbf5c1ecd0ea3ec5fe3f068ddd4739b", "dev": true, "license": "ISC", "dependencies": { @@ -15042,7 +15042,7 @@ } }, "babel-plugin-transform-imports": { - "version": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git#b14734f4531642914c69a95b54ba4779ef8cce56", + "version": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git#e105857c5bbf5c1ecd0ea3ec5fe3f068ddd4739b", "dev": true, "from": "babel-plugin-transform-imports@git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git", "requires": {