File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
packages/pwa-kit-extension-sdk/src/configs/webpack Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 55 * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66 */
77import { LoaderContext } from 'webpack'
8+ import os from 'os'
89import path from 'path'
910import 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
You can’t perform that action at this time.
0 commit comments