Skip to content

Commit fbea6de

Browse files
committed
Clean up fix
1 parent c982ab8 commit fbea6de

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

packages/pwa-kit-extension-sdk/src/configs/webpack/overrides-resolver-loader.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77
import {LoaderContext} from 'webpack'
8+
import os from 'os'
89
import path from 'path'
910
import resolve from 'resolve'
1011

@@ -83,21 +84,10 @@ const OverrideResolverLoader = function (this: LoaderContext<any>) {
8384
// Adjust the `basedir` dynamically for resolving relative imports in the new file
8485
const newBasedir = path.dirname(resolvedResourcePath)
8586

86-
// Provided a match and group representing a relative path, replace it with an absolute path using the new base directory.
87-
// const convertRelativePaths = (match: string, relativePath: string) => {
88-
// const absolutePath = path.resolve(newBasedir, relativePath)
89-
90-
// return match.replace(relativePath, absolutePath)
91-
// }
92-
const os = require('os')
93-
9487
const convertRelativePaths = (match: string, relativePath: string) => {
95-
// Resolve the absolute path
96-
let absolutePath = path.resolve(newBasedir, relativePath);
88+
let absolutePath = path.resolve(newBasedir, relativePath)
9789

98-
// Check if the OS is Windows
9990
if (os.platform() === 'win32') {
100-
// Escape backslashes by replacing \ with \\
10191
absolutePath = absolutePath.replace(/\\/g, '\\\\')
10292
}
10393

0 commit comments

Comments
 (0)